The correct formula for magnesium oxide is MgO.
Magnesium oxide is an ionic compound formed from magnesium and oxygen. In its most basic form, magnesium has a valency of +2, while oxygen has a valency of -2. To achieve electrical neutrality in the compound, one magnesium ion (Mg2+) combines with one oxide ion (O2-), resulting in the formula MgO.
This simple 1:1 ratio of magnesium to oxygen is a hallmark of ionic compounds, where the oppositely charged ions attract each other to form a stable structure. Thus, you can see that understanding the charges of the constituent ions is crucial to deriving the correct formula for magnesium oxide.