Answer: For
,
is the oxidizing agent and
is the reducing agent.
For
, Mg is the reducing agent and
is the oxidizing agent.
Explanation:
An oxidizing agent is defined as the substance which tends to oxidize other substances by itself gaining electrons. As a result, there will occur a decrease in its oxidation state.
On the other hand, a substance which tends to reduce other substances by itself losing electrons is known as an reducing agent. There will occur an increase in oxidation state of a reducing agent.
For example, 
Oxidation: 
Reduction: 
Hence, here
is the oxidizing agent and
is the reducing agent.
Also,

Oxidation: 
Reduction: 
Hence, here Mg is the reducing agent and
is the oxidizing agent.