Why does my shower run hot and cold?
Usually a pressure or flow imbalance, and the specific pattern of when it happens identifies the cause.
If it goes cold when another tap or the toilet is used, the shower is losing cold water pressure. Drawing cold elsewhere reduces cold supply to the mixer, so the proportion of hot rises and the shower goes hot — or, on some systems, the reverse. This is the classic symptom, and the fix is a thermostatic mixer valve, which senses outlet temperature and adjusts automatically to maintain it.
If it cycles regularly without anyone using water, the cause is likely the boiler. A combi boiler modulating around its minimum output can overshoot and undershoot, particularly at low flow rates — a phenomenon sometimes called cold water sandwich when it appears at the start. This is common where a shower's flow rate falls below what the boiler needs to fire consistently.
If it happens with an electric shower, temperature depends on flow rate through a fixed heating element. Reduce flow and the water gets hotter; increase it and it cools. So changing pressure elsewhere in the house changes the temperature directly. A partially blocked showerhead produces the same effect by restricting flow.
If it only happens in cold weather, incoming mains water is colder, so the same heating output produces a lower temperature. Electric showers in particular deliver noticeably cooler water in winter, and many have a winter/summer setting for this reason.
Other causes worth checking:
Limescale in the mixer cartridge, shower hose or heating element, which is the most common failure in hard water areas.
A failing mixer cartridge, which is usually cheap and straightforward to replace.
Unequal pressures where hot is gravity-fed from a tank and cold is at mains pressure — a balanced supply or a pressure-reducing valve is needed.
Airlocks in the pipework.
Shared supply with neighbours in flats, where their usage affects yours.