The functional group present is an ester. Esters have the general formula R-COOR', where R and R' can be any alkyl or aryl group.
Methyl formate specifically has a methyl group (CH3) attached to the oxygen and a hydrogen attached to the carbon of the carbonyl group.
The reason this compound reacts with sodium metal (Na) but not other sodium compounds is because sodium metal is a strong reducing agent that can react with the hydrogen atom attached to the carbonyl group. This reaction forms sodium formate (HCOONa) and releases hydrogen gas (H2).
Other sodium compounds, like sodium chloride (NaCl) or sodium hydroxide (NaOH), are not strong enough reducing agents to react with methyl formate in this way.
Here's the reaction:
HCOOCH3 + Na → HCOONa + 1/2 H2