Dear student,
Good question.We must represent the chemical reaction as
2Mg + O2 = 2MgO
because oxygen exists in nature in O2 form only. We cannot find [O] (representation of single oxygen and is called as nascent oxygen) freely in nature.
[O] may obtain form very few chemical reactions and is very unstable combines with other [O] and eventually forms O2 within fraction of seconds.
So, we should not write chemical reaction as Mg + O =MgO
Or we can write as Mg + 1/2O2 = MgO
we cannot take atomic oxygen(nascent oxygen) as a product here, as it suddenly produces oxygen molecules. Thus the final product is oxygen O2 not O. Also, the reaction of ozone giving oxygen is not written in the way you've given. It is written as
2 O3»»3O2
If you refer any standard textbooks you will find this reaction. Thank you.