Dear Student,
When magnesium is allowed to react with copper sulphate solution an brown deposit of copper metal formed with colourless solution of magnesium sulphate, hence the metal X = Mg and the reaction scheme is,
Mg + CuSO4 = MgSO4 + Cu
Regards.