magnesium iodide = MgI₂
mass of Mg = 24.3g
mass of I = 126.9g
mass of MgI₂ = 24.3 + 2*126.9 = 278.1g = 1 mole
in 5.36x10⁻⁴ mole of MgI₂ ---------------- x g of Mg
in 1 mole of MgI₂ ------------------------------ 1 mole of Mg
x = 5.36x10⁻⁴ moles of Mg = 0.000536 moles of Mg
answer: we've 0.000536 moles of Mg (magnesium ions) in 5.36x10⁻⁴ moles of MgI₂