There is a minhag (custom) to dress in costumes on Purim. This minhag is not just a silly children's activity – there is deep significance behind the masks and costumes we wear on Purim.
A mask or costume hides one's identity. This theme – of hiding one's identity – is one we find often in Megillat Esther. The most obvious example of this is, Queen Esther herself, who hid her identity in the palace of King Achashverosh. Another example is Harvona, whom we remember for good ("zachur latov") due to his suggestion to King Achashverosh to hang Haman on the very same gallows he designed for Mordechai. Our Rabbis tell us that this was actually Eliyahu Hanavi, who had come disguised as Harvona, a close friend and adviser of Haman, and made the suggestion to the king.
We find in the Purim story that while Haman was leading Mordechai on the King's horse, Haman's own daughter mistook her father for Mordechai, and publicly humiliated Haman. According to one explanation, the reason she made this mistake was because Haman had asked Mordechai for permission to don his sackcloth while he led the horse, in order to disguise himself and avoid embarrassment. There is yet another who hid His identity throughout the Megilla – Hashem himself. Hashem's name is never actually mentioned in the Megillah; however, the Vilna Gaon explained that every time the Megillah says the word "HaMelech" (the King), even though it seems to be referring to King Achashverosh, it is a veiled reference to the "King of kings" who orchestrated all the events of the Megillah, while hiding Himself behind the scenes. It is for this reason the Talmud says that when the Torah says V'Anochi haster astir panai bayom hahoo ("And I will hide my face on that day" – Devarim, 31:17), it is referring to Purim.
The Double Indentity The Jewish people also donned a "mask" throughout the Purim story. The Talmud explains that Haman was given the power to destroy the Jewish people as a punishment for the Jews' attendance at Achashverosh's feast. Even though, according to many opinions, the food at the feast was 100% kosher and no halachot were broken, the Jews were guilty of trying to hide their Jewish identity and blend in with the gentiles. In order to repent, Esther asked them to fast for three days in order to "remove the food of Achashverosh's party" from themselves and stop hiding their true identity.