How does pH change during the electrolysis of water? How does the pH change during electrolysis of a water and  magnesium sulphate solution? Also, will this pH change happen every time? Does the pH change differently when there is just water in the anode and cathode?
The pH will decrease, because magnesium sulphate is acidic.   

As the electrolysis proceeds, the magnesium sulphate becomes more concentrated.