Vegetable oils are triglycerides of unsaturated fatty acids, meaning their long carbon chains contain several $C=C$ double bonds. This is why they stay liquid at room temperature.
- To convert this liquid oil into a solid fat, vanaspati, the double bonds must be removed.
- This is done by bubbling hydrogen gas through the heated oil in presence of finely divided nickel catalyst, a process called catalytic hydrogenation.
- Each $C=C$ bond picks up one $H_2$ molecule and becomes a single bond $C-C$, raising the melting point and turning the oil solid.
- Oxygen is ruled out because it would cause oxidation and rancidity, not solidification. Nitrogen and carbon dioxide are chemically inert towards the double bond under these conditions.
So the gas required is hydrogen, making option A correct.