Which of the following is an oxidising agent in 2Mg+O2(g)→2MgO(s)
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.