The correct option is B O2
An oxidizing agent or oxidant is a substance which supplies oxygen or any other electronegative element or removes hydrogen or any other electropositive element. Alternatively, an oxidizing agent or oxidant is that substance which itself undergoes reduction in a chemical reaction.
Here Mg is oxidised and O2 is reduced.
Therefore O2 is an oxidising agent.