(a) Gay Lussac's law of gaseous volumes: when gases combine or are produced in a chemical reaction, they do so in a simple ratio by volume, provided all the gases are at the same temperature and pressure. Here NH3:N2:H2=2:1:3.
(b) Using the volume ratio 2:1:3:
V(N2)=21×40=20 mL,V(H2)=23×40=60 mL
total=20+60=80 mL
The volume of gas doubles, from 40 mL to 80 mL.
(c) By Avogadro's law, equal volumes of gases at the same temperature and pressure contain equal numbers of molecules, so the number of molecules is proportional to the volume. 2 volumes of ammonia become 1+3=4 volumes of products:
molecules beforemolecules after=40 mL80 mL=24=2:1

The mass does not change. Every N and H atom in the ammonia ends up in the N2 and H2 molecules; the atoms are only rearranged into more, smaller molecules. Volume and number of molecules need not be conserved in a reaction, but mass always is.