Initially note that 2.37 g + 3.04 g = 5.41 g, which means that the sample was a compound of only N, H and O.
Convert the masses of N2 and H2O into number of moles by using the molar masses of each.
1) N
moles = mass of N2 / molar mass of N2 = 2.37 g / ( 14.0 g/mol) = 0.169 mol of N
2) H2O
moles = mass of H2) / molar mass of H2O = 3.04 g / (18.0 g / mol) = 0.169 mol
0.169 moles of H2O => 2 * 0.169 moles of H and 0.169 moles of O
3) Emipirical formula
N: 0.169 / 0.169 = 1
H: 2* 0.169 / 0.169 = 2
O: 0.169 / 0.169 = 1
=> NH2O
4) Molar mass of the empirical formula: 14.0 g/mol + 18 g/mol = 32 g/mol
5) Number of times that the empirical formula is contained in the molecular formula: 64 g/mol / 32 g /mol = 2
6) Molecular formula = 2 * Empirical formula = N2H4O2
Answer: N2H4O2