Every year, the Fast of Esther is held on one of the days prior to Purim. Usually it is the day immediately before Purim, though there are exceptions. (see Law #4 below)
What is the source of this fast?
In the Megillah (4:16), Esther agrees to see the king uninvited, and asks the Jewish People to fast for three days beforehand.
Why did she call for a fast? Because a fast helps to lower the volume on our physical pursuits in order to focus more acutely on our spiritual selves. This facilitates the process of "teshuva" -- literally "return." We return to our essential state of purity. Esther called for a fast, knowing that through soul-searching the Jews would forge a spiritual connection necessary to make her mission successful. (And it paid off!)
This is not a fast of sadness. Rather, the purpose of the fast is elevation and inspiration.
Similarly, there was another fast during the Purim story: The Jews fasted and prayed on the 13th of Adar in preparation for their defense against Haman's decree. The Torah prescribes that whenever a Jewish army goes to war, the soldiers should spend the previous day fasting. This is in stark contrast to a secular army which spends the day preparing weapons and armaments. A Jew's best weapon is the recognition that strength and victory come only through God (see Exodus 17:10). Additionally, the fact that we are physically weakened when the battle begins, assures us that any victory cannot be attributed to our physical prowess.
Mortals have limits, but God can achieve the impossible. (Case in point: the Six Day War.) As Mark Twain wrote, "All things are mortal but the Jew; all other forces pass, but he remains. What is the secret of his immortality?"
It is actually this one-day pre-battle fast that we commemorate every year before Purim. However, in honor of the Purim heroine, it is called Taanit Esther -- the Fast of Esther.
HALACHAS (LAWS) OF FAST OF ESTHER
1) The fast begins at dawn ("Alot Hashachar") and ends after nightfall ("Tzait Hakochavim").
2) No eating or drinking is permitted. Though other aspects -- like wearing shoes and washing -- are permitted.
3) Since this is not a major fast, pregnant or nursing women are exempt from the fast, as are moderately ill people. If one is otherwise healthy but has a headache and finds it difficult to fast, he may eat, but is obligated to "make up" the fast another time. In all cases, a competent rabbi should be consulted.
4) If the 13th falls on Shabbat, we don't fast that day, due to the honor of Shabbat. The fast is not even held on Friday, since this would adversely affect Shabbat preparations. Rather, we observe the fast on Thursday, the 11th of Adar.
5) It is customary to extend the fast until after the Megillah is read. (Except in walled cities, where the Megillah is read on the night of the 15th.)
6) During the afternoon Mincha prayers, the paragraph of Aneinu is added to the silent Amidah, during the blessing of Shema Koleinu. In both Shacharit and Mincha, the chazan inserts Aneinu as a separate blessing between Geulah and Refuah.
7) As on other public fasts, the Torah reading of Vayechal Moshe (Exodus 32:11-14, 34:1-10) is read both at Shacharit and Mincha.
8) If a Brit Milah falls on the Fast of Esther, the Seudat Mitzvah should be be postponed until the evening. The father, mother, and Sandek may even eat during the afternoon of the fast day, since it is considered like their "holiday." (Sha'ar HaTziun 686:16)
9) Avinu Malkeinu is said only in Shacharit, but not in Mincha. (An exception is if Purim falls on Sunday and the fast is observed on Thursday, then Avinu Malkeinu is in fact said in Mincha.)