The thermostatic valve is defective in this instance. In most gravity fed showers this consists of a cartridge of "waxed paper" which reacts to the temperature fluctuations and regulates accordingly. If your shower is an "Aqualisa" you're in luck as they have an excellent spare parts service and carry spares for many older models. As for other brands I'm not sure. Your best bet is to take whatever details you can find and go to a plumber's merchant. The part shouldn't be expensive and is quite easy to replace.