Hadith 2494
It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When a person dies, his deeds come to an end except for three things: ongoing charity, knowledge from which people benefit, or a righteous child who prays for him."
Hadith 2495
Sayyiduna Abu Qatadah (may Allah be pleased with him) narrates that I heard the Messenger of Allah (peace and blessings be upon him) say: "The best things that a person leaves behind are three: a righteous child who prays for him, so his prayers reach him; or ongoing charity that he leaves behind, so its reward continues to reach him; or beneficial knowledge that he leaves behind, upon which people act (so he continues to receive its reward)."