The Halachic authorities debate the question as to the status of prescription medication on Shabbat. It goes without saying that if somebody is sick, such that he experiences debilitating weakness, he is allowed to take medication on Shabbat to treat his condition. The question arises in the case of a person experiences some discomfort, and the doctor prescribed medication for him to take for a certain number of days, including Shabbat, in order to cure the ailment which causes the discomfort. Rav Moshe Feinstein (1895-1986), in Iggerot Moshe (Orah Haim 3:53), ruled that since the patient is not actually sick, there is no reason to permit taking the medication. Skipping the medication for a day will have the effect of merely delaying the cure, and thus, as the person is not actually sick, he cannot take the medication on Shabbat.
The Hazon Ish (Rav Avraham Yeshaya Karelitz, 1878-1953), however, ruled differently. He asserted that any patient for whom a doctor prescribes medication is considered “sick” with respect to the laws of medication on Shabbat. Even though the patient is not sick in the sense that he has difficulty functioning, and normally medication for this condition would be forbidden on Shabbat, nevertheless, once the doctor instructed him to take medication for a period of time, he is considered “sick” and may take the medication on Shabbat.
If a person feels unwell on Shabbat and wants to start taking antibiotics in case the infection is bacterial, he is allowed to take the medication. Rav Shlomo Miller writes that since a bacterial infection poses a potential risk to one’s health, taking antibiotics for a bacterial infection is certainly permissible on Shabbat. And, if the infection is viral, and not bacterial, then the medication will have no effect, and therefore taking the medication would not fall under the prohibition of Refu’a (“healing”) on Shabbat.
Summary: Any medication that was prescribed by a physician, who instructed taking the medication for a period that includes Shabbat, may be taken on Shabbat. If one feels unwell on Shabbat and wishes to begin taking antibiotics in case his infection is bacterial, he is allowed to do so.