Since mercury oxide (HgO) decomposes into Hg(l) and O2 (g), the balanced equation is 2HgO(s) -> 2Hg(l) + O2(g).
The molar mass of mercury oxide is about 216.59 g/mol, so divide 12 grams of mercury oxide by its molar mass of 216.59 g/mol, which should give you about 0.055 moles.
Based on the balance equation, the ratio of the diatomic oxygen molecule (O2) and mercury oxide (HgO) is 1:2. Thus, divide the moles of HgO by 2. Doing so will give you the moles of the diatomic oxygen molecule, which is about 0.028 moles.
Now you can convert the moles of oxygen to grams. The molar mass of a single oxygen molecule is 16 grams/mol, therefore, the diatomic oxygen molecule is 32 grams/mol (16 x 2). Note: it is 32 grams per mol. As a result, you would multiply 0.028 moles by 32 grams which should give you an answer of about 0.89 grams of oxygen for every 12 grams of mercury oxide that is decomposed.