Shower runs cold, then hot, then cold. Faucet in same bathroom runs hot after shower
Besides clogged pipes as described by Programmer66, thermostatic shower valves are known for this problem. The cold and hot water side is mixed upstream of the closing valve. In normal faucets, the mixing is downstream of the valves. To avoid cold water to be pushed into the hot water pipes (and vice versa), thermostatic valves have special pressure balancing or one-way valves that could be made with diaphragmas, which are not reliable in the long run being  a rubber-like thin material, especially the element in contact with the hot water. A Google search "thermostatic shower valve temperature problem" will present many Infos including DIY videos.