Mg: it has a fixed oxidation number 2+ in any compound
O: it has an oxidation number 2-, except in peroxides.
The oxidation number of S is such that the net charge of the compound, Mg SO4 is zero.
Call x the oxidation number of S:
(2+) + (x) + 4(2-) = 0 => x = +8 - 2 = +6
Answer: Option C. +6