Is it permissible to handle food on a fast day, such as to prepare meals for children or for after the fast, or to go grocery shopping, or does Halacha forbid contact with food, given the concern that one might forgetfully eat?
The Taz (Rabbi David Halevi Segal, 1586-1667), in his commentary to the Shulhan Aruch (Orah Haim 612:8; listen to audio recording for precise citation), cites a ruling from the Terumat Hadeshen (Rabbi Yisrael Isserlin, 1390-1460) concerning the issue of handling food on Yom Kippur. The Terumat Hadeshen writes that it is proper not to handle food on Yom Kippur, just as one should not handle Hametz on Pesah. However, the Terumat Hadeshen concludes, the prevalent custom is to be lenient in this regard and to allow handling food on Yom Kippur. The Taz explains that we allow handling food on Yom Kippur because the "Emat Ha’yom" – the aura of fear and dread that prevails throughout the day of Yom Kippur – ensures that one will remain mindful of the fast and not taste any food.
Would this apply to the other fast days, as well?
The Peri Hadash (commentary to the Shulhan Aruch by Rav Hizkiya De Silva, 1659-1698) ruled that one may handle food on the other fast days, on the basis of a ruling of the Rama (Rabbi Moshe Isserles of Cracow, 1525-1572) in a different context. The Rama writes (in Orah Haim 471) that one may crush Masa to make Masa meal on Ereb Pesah. Even though Halacha forbids eating Masa on Ereb Pesah, there is no prohibition against handling Masa on this day. The reason, the Peri Hadash writes, is because the prohibition against eating Masa on Ereb Pesah applies only on the level of "Mi’de’rabbanan" (Rabbinic enactment), and we therefore do not go so far as to enact a safeguard and forbid handling Masa. This rationale should apply equally to the fast days (other than Yom Kippur) which were established by the Sages, and do not constitute a Torah obligation. Just as one may handle Masa on Ereb Pesah despite the prohibition against eating Masa, similarly, it is permissible to handle food on a fast day, despite the prohibition against eating.
Hacham Ovadia Yosef draws an interesting parallel between this Halacha and the prohibition against the commercial sale of Ma’achalot Asurot (non-kosher food). Halacha forbids selling forbidden food commercially, even to gentiles. The Rashba (Rabbi Shelomo Ben Aderet of Barcelona, 1235-1310), in one of his responsa, explained this prohibition as based on the concern that one who deals commercially in forbidden foods might eat some of the merchandise. Interestingly enough, this prohibition applies only to foods that are forbidden for consumption by force of Torah law; it does not apply to foods which the Torah permits but are forbidden by force of Rabbinic enactment. This demonstrates that the Sages did not go so far as to forbid handling food forbidden "Mi’de’rabbanan" out of the concern that one may forgetfully eat it. Similarly, then, on fast days, when eating is forbidden only by force of Rabbinic enactment, it is permissible to handle food, especially if one needs to prepare meals for children.
Summary: Even though eating and drinking is forbidden on fast days, it is permissible on fast days to handle food, such as to prepare meals for children or go grocery shopping.