In the days of Mordechai and Esther, the Jews gathered together on the thirteenth of Adar to defend themselves against their enemies. They needed to ask mercy from G-d to assist them. When the Jews went to war, they would fast so that G-d would aid them, as Moshe did when we went to war against Amalek. Because of this, we can assume that at the time of Mordechai and Esther, they fasted on the thirteenth of Adar. This day has been accepted by the Jewish people as a communal fast called Taanis Esther, a reminder that G-d watches us and hears each person’s prayers in his time of trouble when he fasts and sincerely returns to G-d, just as He did for our ancestors in those days.
Pregnant and nursing do not fast if they are feeling weak. The Mishnah Berurah (686:4) cites a debate amongst the poskim whether a pregnant or nursing woman must fast in the event that she feels fine. He concludes (Shaar Hatzion 10) that each person should follow the custom of his area. The opinion of the Aruch Hashulchan (686:4), Kaf Hachaim (686:21) and Divrei Yetziv (O.C. 2:291) and Harav Shlomo Zalman Auerbach zt”l (oral ruling cited by Harav Nevenzhal shlit”a B’Yitzchak Yikareh) is to be lenient and all pregnant and nursing women need not fast. For normative halacha a rav should be consulted. All agree that a women who gave birth in the last month does not fast even if she feels great (Mishnah Berurah ibid.).
In the event that a nursing or pregnant woman is not fasting, the poskim debate whether she must make up the fast on a different day. For normative halacha, a rav must be consulted.
The Rama (686:2) rules that a Choleh Shein Bo Sakana (bedridden) or someone with an eye ache who is in great pain may eat on Taanis Esther but should make up the fast on another day. The Kaf Hachaim (686:22) adds that anyone who has to eat on the doctor’s orders doesn’t have to make it up afterwards. Before one decides to break his fast he should first consult with a rav.
The fast of Taanis Esther begins at dawn. Even though the fast begins from dawn, sometimes the prohibition against eating begins from the previous evening. For example, if, before the arrival of dawn, a person decides not to eat any more until the fast begins, he is seen as having accepted the fast upon himself, and it is now forbidden for him to eat. Therefore, if a person goes to bed in anticipation of the fast and then rises before dawn, it is forbidden for him to eat, for he diverted his thoughts from eating. If one wishes to wake up before dawn (5:47) and eat or drink, he should stipulate before going to sleep that he intends to wake up early to eat or drink and that the fast should not begin until dawn. The Shulchan Aruch (564) rules that if one did not make this stipulation he may not eat or drink. However, according the Rama he may still drink, even without making a stipulation.
One need not train his children to fast, even at the age of twelve for boys or eleven for girls. Once they have reached the age of chinuch they shouldn’t eat lavish meals, but rather only what is necessary. Harav Shlomo Zalman Auerbach zt”l and ybc”l Harav Neventzhal shlit”a write that although many boys have the custom to fast three fasts before they become bar-mitzvah, this custom has no source. (Mishnah Berurah 550:5, Halichos Shlomo vol. 3 page 398-399 and B’Yitzchak Yikare on Mishnah Berurah)
The Mishnah Berurah (567:11) maintains that only if one is in pain may one rinse one’s mouth on a public fast day (such as Taanis Esther) and in such a case one should bend one’s head downward so one doesn’t swallow any water.
If one has bad breath and it causes him discomfort or embarrassment, he may use mouthwash on Taanis Esther. He may also brush his teeth with toothpaste but not with water. (Beer Moshe 8:94, Minchas Yitzchak 4:109)
If one needs to take medicine on Taanis Esther he may take them without water. If he cannot swallow the pills without a little water, he may swallow a very small amount of water (just enough to get the pills down). (Opinion of Rav Debreczin zt”l cited in Nitev Gavriel Bein Hatzomos page 54)