IS MELACHAH FORBIDDEN ON PURIM?
Gemara
R. Eliezer: Rebbi planted a tree on Purim
Question: How could he do so?
(Rav Yosef - Beraisa): "(The days of Purim are for) Simchah" - this forbids eulogies. "Mishteh" forbids fasting; "Yom Tov" forbids Melachah.
Answer #1: Rebbi planted on the 14th, and celebrated Purim on the 15th (he lived in Tiverya, a walled city).
Question: Work is forbidden on both days!
Megilas Ta'anis (a Beraisa which lists days of celebration): The 14th and 15th are days of Purim on which we may not eulogize.
Rava: (Since we already know this from Megilas Esther, surely) this teaches that the Isurim apply on both days, regardless of which day one celebrates.
Answer: Rava teaches about eulogies and fasting, but not Melachah.
Question: But Rav cursed a man for planting flax on Purim, and the flax didn't grow!
Answer: The case was, he planted on the day he celebrates.
Answer #2 (to Question (2) - Rabah): We can even say that Rebbi planted on the day he celebrates. Yisrael never accepted to refrain from work on Purim.
Support: The Megilah records that Mordecai wanted to enact Yom Tov, but when it records Yisrael's acceptance of Purim, it omits this.
Question: If so, why did Rav curse the man?
Answer: In Rav's area, people had a custom not to work (one may not act leniently in front of them);
Version #1: There was no such custom in Rebbi's area.
Version #2: There was such a custom in Rebbi's area; Rebbi planted a tree of Simchah.
Mishnah: If the (three series of) fasts (over lack of rain) finished and rain did not come, we decrease business, building, planting, engagements and weddings.
Beraisa: Only building and planting of Simchah is prohibited, such as a house in which to marry off one's son or a king's orchard. (These are permitted on Purim.)
Pesachim 50b - Beraisa: If one works at any of the following times, his work will never be blessed:
After Minchah on Erev Shabbos or Erev Yom Tov; Motza'ei Shabbos, Yom Tov or Yom Kipur; any time when there is (even) a tinge of a transgression;
This comes to include a Ta'anis Tzibur.
Rishonim
Rif and Rosh (1:8) (Rav Yosef - Beraisa): "Simchah" forbids eulogies; "Mishteh" forbids fasting; "Yom Tov" forbids Melachah.
Rava brei d'Rabah: Yisrael accepted to forbid eulogies and fasting, but not Melachah;
At first it says "Simchah u'Mishteh u'Yom Tov", but in the end it says (that Yisrael accepted only) "Simchah u'Mishteh".
Rif and Rosh (ibid.): The Halachah follows Rava.
Rambam (Hilchos Megilah 2:14): The 14th of Adar for open cities and the 15th for walled cities are days of Simchah, Mishteh, Mishlo'ach Manos and Matanos la'Evyonim. It is permitted to do Melachah. Nevertheless, Chachamim taught that there will be no Berachah on work done on Purim.
Source (Magid Mishnah): The Rambam rules like Rava because he is Basra.
Question (Lechem Mishneh): Why does the Rambam not mention that in some places the custom is to forbid Melachah, and in other places we permit? He also omits the distinction between planting of Simchah and other planting!
Hagahos Maimoniyos (400): The She'altos learns from the episode with Rav that if one does Melachah where the custom is to forbid it, we excommunicate him.
Poskim
Shulchan Aruch (OC 696:1): It is permitted to do Melachah on Purim. In a place where the custom is not to, we do not.
Beis Yosef (DH V'Chosav): The custom (in some places) is to forbid Melachah on the day of Kri'as ha'Megilah.
Mishnah Berurah (6): One may write a friendly letter, an accounting of debts, or anything that does not require deep thought. Nevertheless, one should not spend too much time on them lest it detract from Simchas Purim.
Kaf ha'Chayim (2): The Mishbetzos Zahav (1) says that everywhere Melachah is permitted at night. The Chasam Sofer forbids even the night.
Kaf ha'Chayim (3,4): One who lacks what to eat may work for wages, for this is Simchah. Likewise, Devar ha'Eved is permitted, for otherwise a person's Simchah would be hindered. One may do Melachah through Nochrim. However, if one was building a house through Nochrim they should desist on Purim for it is flagrant. Building for a Mitzvah, e.g. a Beis ha'Keneses, is permitted.
Rema: Nowadays, in every place the custom is not to do Melachah.
Shulchan Aruch (ibid.): There will be no Berachah on work done on Purim, unless it was building something for Simchah such as a house in which he will marry off his son or a king's orchard for shade.
Source (Gra DH veha'Oseh): Pesachim 50b teaches that there will be no Berachah whenever there is a tinge of a transgression.
Magen Avraham (2): The Beis Yosef connotes that there will be no Berachah on Meleches Purim in a place where the custom is not to do Melachah. The Rambam says this about all places.
Kaf ha'Chayim (8): Poskim argue about whether or not we excommunicate one who does Melachah, therefore we do not excommunicate. However, Beis Din should fine him and give all his profit to Aniyim.
Rema: Melachah of a Mitzvah is permitted, such as writing Halachos.
Source (Gra DH u'Mutar and DH Kasuv): We learn from Shekalim (1:1), which says that on the 15th of Adar we read the Megilah in walled cities and fix roads and Mikva'os and do all public needs. Even regarding Chol ha'Mo'ed, there is an obligation to attend to such needs (Mo'ed Katan 5a). The Mishnah (17a) discusses whether or not one who was writing the Megilah was Yotzei Kri'as ha'Megilah. Torah is "Mesamchei Lev", therefore writing Torah is permitted like planting for Simchah.
Taz (1): Similarly, commerce is permitted since it gladdens a person, even though it is forbidden on Tish'ah b'Av.
Kaf ha'Chayim (5): The Keneses ha'Gedolah says that commerce is improper where people do not do Melachah, just Beis Din does not punish for this unless they specifically warned the person.
Kaf ha'Chayim (11): When Purim is on Erev Shabbos, some permit to cut hair to honor Shabbos. Others permit only through Nochrim.
Rema (ibid.): One may do even proper Melachos for the sake of Purim.
Shulchan Aruch (2): A custom to forbid Melachah on the other day (the 14th in a walled city or the 15th in an open city) is not a valid custom.
Kaf ha'Chayim (14,15,16): Maharil and Avudraham say that this is a proper custom. It is certainly proper when it is doubtful if the city was walled from the days of Yehoshua. Avudraham says that women do not do Melachah on either day.