The Shulhan Aruch (Orah Haim 326) writes that it is forbidden to bathe one’s entire body with warm water on Shabbat, even if the water was heated before Shabbat. In ancient times, somebody might have wanted to heat water before Shabbat, leave it in a basin, and then pour it over himself on Shabbat. As far as the Torah prohibitions of Shabbat are concerned, he has done nothing wrong. However, the Sages enacted a law forbidding bathing with hot water on Shabbat, because those who ran bathhouses would heat water for their patrons on Shabbat – an act of Shabbat desecration – and falsely claim that it was heated before Shabbat. In order to safeguard against this form of Shabbat desecration, the Sages forbade bathing on Shabbat with warm water even if the water had been heated before Shabbat.
The Sages did, however, make a number of exceptions to this rule. One exception is "Hameh Teverya" – the natural hot springs in Tiberias, which may be used for bathing on Shabbat.
Another exception, which the Bei’ur Halacha (Rav Yisrael Meir Kagan of Radin, 1839-1933) notes, is the case of a person who would experience considerable discomfort if he does not bathe with warm water. One example, noted by Hacham Ovadia Yosef, is a person who normally showers with hot water each day, and would be very uncomfortable if he does not shower on Shabbat. Such a person, in principle, is permitted to shower on Shabbat with water heated before Shabbat.
The Halachic authorities debate the question as to the temperature required for bathing to be forbidden. Hacham Bension Abba Shaul (Israel, 1924-1998) ruled that water is forbidden for bathing on Shabbat only if its temperature exceeds body temperature (98.6 F). Even if the water is warm, one may bathe with it on Shabbat, as long as it is does not exceed body temperature. Others, however, including Hacham Ovadia Yosef and Rabbi Moshe Ha’levi (Israel, 1961-2000), rule more stringently, and maintain that water is forbidden for bathing unless it is room temperature. In their view, it is forbidden to bathe on Shabbat even with lukewarm water. Hacham Ovadia brings several proofs to this position, including the simple historical fact that in ancient times, when this prohibition was enacted, people did not have modern-day boilers, and thus did not have access on Shabbat to very hot water that was heated before Shabbat. Necessarily, then, when the Sages forbade bathing with hot water that was heated before Shabbat, they referred to lukewarm water. Moreover, the Shulhan Aruch rules that a person who washed may not then stand near the fireplace, because the warmth of the fire will heat the water, and the individual will then be bathing in warm water. Clearly, this water will only become lukewarm, and not actually hot, yet it is forbidden for bathing. Therefore, bathing is allowed on Shabbat only with water that is no warmer than room temperature.
It should be noted that according to Sephardic practice, it is permissible to bathe in cold water on Shabbat. (Ashkenazim refrain from bathing on Shabbat even in cold water, as noted by the Mishna Berura.)
Practically speaking, this Halacha is not too relevant to our modern-day circumstances, when we have plumbing and electric boilers. Turning on the hot water has the effect of allowing new water to enter the boiler, and that water is heated when it comes in contact with the hot water in the boiler. Therefore, although the water in our boilers on Shabbat was heated before Shabbat, practically speaking, it would not be allowed to access that water, since this would have the effect of heating the new water which enters the boiler. Therefore, even if one experiences discomfort, he would not be allowed to bathe in water from the boiler. This would be allowed only if he filled the bathtub with hot water before Shabbat began.
Summary: It is forbidden to bathe on Shabbat in water warmer than room temperature, even if it was heated before Shabbat. In principle, somebody who will experience discomfort if he does not bathe in hot water is allowed to bathe on Shabbat in hot water that was heated before Shabbat. However, since it is forbidden to turn on the hot water faucet on Shabbat (as this causes cold water to enter the boiler and become heated), this would be permitted only if one filled a bathtub with hot water before Shabbat. Bathing in cold water on Shabbat is allowed according to Sephardic practice.