What are the oxidation states of sulfur in the tetrathionate ion?
Consider the structure of tetrathionate. The two central sulfurs each have two lone pairs and are assigned half of the electrons from the two bonds they make, since the electrons of bonds between atoms of the same element must be distributed evenly (due to there being, by definition, an electronegativity difference of zero between two atoms of the same element). A neutral sulfur atom has six valence electrons, so the oxidation state of the central sulfurs can be calculated as follows:

$$6 - 4 - \frac{1}{2}(4) = 0$$

That is, six electrons in neutral sulfur, minus four from the lone pairs, minus half of the four sulfur-sulfur bonding electrons, gives zero.

The terminal sulfurs, on the other hand, have no lone pairs, and all the electrons from the sulfur-oxygen bonds are assigned to oxygen, since it's the more electronegative element. The only electrons assigned to those sulfurs are half of those from the sulfur-sulfur single bonds. Hence, their oxidation state is:

$$6 - \frac{1}{2}(2) = +5$$

That is, six electrons in neutral sulfur, minus half of the two sulfur-sulfur bonding electrons, giving an oxidation state of +5.