Our Gemara on Amud Beis mentions that we eulogize a child of age five or six.  This is a idea, there is a popular belief that the evil inclination enters a child from birth, but the Yezer Hatov only enters the child at Bar or Bas Mitzvah.  (see Koheles Rabbah 4:13 and Sanhedrin 91b).  Yet, by the fact that we eulogize a child, this shows that even a small child is capable of performing righteous deeds. And this is a very important comfort for parents who lose a child and saw his or her day-to-day actions which indeed represented moral and loving and God-fearing activity. How can we square away the obvious evidence that some children choose to do good and be moral with our traditions teachings?

Indeed, the Gemara (Yoma 82b) implies that even a fetus is capable of good and bad choices, as the Gemara there contrasts two stories where a pregnant woman had cravings on Yom Kippur.  Before giving The women to eat, the rabbi whispered to the fetus reminding him that it is Yom Kippur. In one case, the cravings quieted down. In the other case the woman still needed to eat. Rabbi Chanina reflected that this was a harbinger of the character of each of the fetuses. Indeed, the one who did not eat grew up to be Rabbi Yochanan, and the other one a gluttonous evil person.

Furthermore, we don’t have to go deeper than a Rashi (Bereishis 25:22) We all learned in grade school. Esau and Jacob distinguish themselves even as fetuses, and that when their mother Rivka would walk by a Bais Midrash, Jacob would start to stir and struggle as if he wanted to get out and join them. On the other hand, when she passed by a house of idolatrous worship, Esau would struggle to exit. Clearly we are seeing at least with some fetuses already their moral choices are manifest in their behavior.

Gur Aryeh Bereishis 8:21 Explains that actually before a person reaches intellectual maturity, in truth there is neither Yetzer Hara nor Yetzer Hatov. True good and evil only comes from the ability to make choice which only can come from a fully formed ego. On the other hand, there are drives and desires that are more instinctive. The various teachings that say that there is evil inclination From birth mean to say that the basic drive is toward physicality, which often is evil. However, it is possible that a great person with a holy soul can have some natural inclination toward higher more spiritual things. It’s not exactly either a Yetzer Hatov because once again it is not representative of fully developed reason. However, it does represent a kind of goodness. This would be the basis for eulogizing a young child.