Question: is mg a cation or anion?
Answer: Magnessium is a group 2 metal that forms cations with a stable noble gas electronic configuration when it loses its two valence electrons. Bromine forms a stable noble gas electronic configuration when it gains one electron. Thus we find magnesium as 2+ cation and bromine as a 1- anion in a 1:2 ratio in the compound.