The empirical formula of Magnesium Oxide is MgO
In order to prove this you need to calculate how many moles of magnesium and how many moles of oxygen there are and how it all works together. A very common example of proving it is using 0.297 g of magnesium and getting 0.493 g of the oxide after a reaction.
Mass of Mg = 0.297
Mass of MagnesiumOxide = Mass of Mg + Mass of O
0.493 g = 0.297 g + Mass of O
Mass of O = (0.493 - 0.297)g = 0.196g
Moles of Mg = 0.297 g Mg x 1 mol Mg/24.3g Mg = 0.01222 mol Mg
Moles of O = 9.196 g O x 1 mol O/16g O = 0.01225 mol O
Now you divide both the numerator and the denominator by the smaller value and you'll see that the results is MgO