You get a displacement reaction. The more electropositive magnesium metal goes into solution forming magnesium ions and the copper ions receive two electrons and form metallic copper.
equation;
Magnesium + copper sulphate = magnesium sulphate + copper



