The Green Hexa-pus is telling the truth.
First we will figure out how many are telling the truth:
If there is more than one octopus telling the truth we would have 2 or more octopi with the same answer for the number of legs.
If they are all lying then they either have a combination of 6 or 8 legs. Which means that there could only be 24, 26, 28, 30, or 32 legs. Looking at the answers, we can see that if they are all lying they would not mention 26 or 28 legs. Hence only one octopus is telling the truth.
This leaves one possibility: One octopus is telling the truth!
Now that we know that only one octopus is telling the truth. We find out which one!
We start by assuming if one octopus is telling the truth or not and then prove or disprove that claim.
So lets say blue is telling the truth: so the blue one has either 6 or 8 legs. And each of the other octopus is lying hence has 7 legs. So our total legs becomes:
6 + 7 + 7 + 7 = 27 legs
or 8 + 7 + 7 + 7 = 29 legs
. But since blue says "28 legs", it contradicts the two possibilities of 27 and 29 legs hence he is lying.
Similarly for yellow and red, the leg combination possible would be 27 or 29, but they said 26 and 25. Hence they are lying.
The green octopus is the only one who gets the correct combination of legs hence he is telling the truth. The Green Octopus has 6 legs and the other three have 7 legs each.