Procedure: The first set of data are use to determine the empirical formula, then the molar mass is used to detemine the molar mass.

1) Quantity of each elements

C: it is only present in CO2.

The ratios of each element in CO2 are: 1 atom C /  2 atom O or, using the atomic masses, 12 g C / 32 g O

Then in 12.00 g of CO2 there are: [12 g C / 44 g CO2] * 12.00 g CO2 = 3.2727 g C

The ratios of each element in H2O are: 2 atom H / 1 atom O or, using the atomic mass, 2 g H / 16 g O

Then in 3.684 g of water there are: [2 g H / 18 g H2O] * 3.684 g H2O = 0.4093 g H

Then the original sample had 8.048 g of Sample – 3.2727 g of C – 0.4093 g of H =  4.366 g of O

2) Now, convert he masses of each element into moles, using the atomic mass of each element

C: 3.2727 g / 12.0 g/mol = 0.2727 mol
H: 4.093 g / 1.0 g/mol = 0.4093 mol
O: 4.366 / 16.0 g/mol =  0.2729 mol

3) Now divide by the smallest number (0.2727) to find the proportion of the elements

C: 0.2727/ 0.2727 = 1.0
H: 0.4093 / 0.2727 = 1.5
O: 0.2729/ 0.2727 = 1.0

Given the the number of mols of H is 1.5 multiply all the numbers by 2 to obtain integer numbers =>

C: 2
H: 3
O: 2

Then, the empirical formula is C2 H3 O2

4) Find the mass of the empirical formula

C: 2 mol * 12.00 g/mol = 24 g
H: 3 mol * 1 g /mol = 3 g
O: 2 mol * 16 g /mol = 32 g

Total mass: 24g + 3g + 32 g = 59 g

5) Finally find the number of times that this mass (59g) is contained in the molar mass (118.1 g) = 118.1 / 59 = 2.00

This is the number for which you have to multiply all the subscripts of the empirical formula to get the molecular formula =>

Then, the molecular formula is C4 H6 O4