According to the Mishna (2a) even children were supposed to be taken on the holiday trip to Jerusalem, unless they were so small that they could not ride on their father’s shoulders up to the Temple Mount (according to Bet Shammai) or hold their father’s hand and make that trip (according to Bet Hillel).
According to both opinions, the issue at hand is whether the child was old enough to be able to travel from the city of Jerusalem up to the Temple Mount with his father’s assistance. Our Gemara quotes Rabbi Zeira as asking how the child got to Jerusalem, if they are so young that they could not finish the trip. In response, Abaye explains that a younger child may have traveled to Jerusalem under his mother’s care, since she is obligated in simhat ha-regel (to participate in the joy and celebration of the holiday), and so, likely accompanied her husband to Jerusalem.
Abaye’s answer raises the question of a woman’s place in the mitzva of aliya la-regel. A woman’s obligation in simhat ha-regel is derived from the passage in Sefer (Book of) Devarim (14:26) which commands men to celebrate together with their households. Nevertheless, this obligation is not clearly defined. Rashi does not appear to connect it with holiday sacrifices, rather he understands that it obligates a husband to do everything in his power to ensure that his wife participates in the joy of the holiday celebration. One logical conclusion would be that a married woman should spend the holiday together with her husband. Tosafot does connect this commandment with the holiday sacrifices, and he sees the husband as being obligated to bring shalmei hagiga – korbanot which are eaten (in part) by their owners – and share them with his wife. Some interpret the Rambam as agreeing with Tosafot, but the Lehem Mishna understands that the Rambam obligated the woman herself to bring these sacrifices, so she would have had to go to the Temple herself, as well.