Is there any source in the Talmud for the concept that an unborn child has awareness and can learn during the gestation period?
In the Babylonian Talmud (Tractate Nidah, p.30b, s.v. darash Rabi Simlai) there is an extensive description of the state of the fetus in its mother's womb. The Talmud teaches that the unborn child is taught the entire Torah while in the womb. When the fetus exits the womb in order to be born an angel comes, strikes it on its mouth, and makes it forget everything it has studied. It will be necessary for the newborn to relearn the Torah during its lifetime. The Talmud (ibid.) records many other fascinating teachings about the life of the unborn child during the months of gestation.