It is narrated from Sayyiduna Salman al-Khayr (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "There are four deeds of the living whose reward continues to reach the dead: first, a man who leaves behind righteous offspring who keep supplicating for him, so their supplication keeps reaching him; second, a man who gives a charity that continues after him, so as long as it continues he keeps receiving its reward; third, a man who teaches some knowledge which is then acted upon after him, so he receives a reward equal to that of the one who acts upon it, without anything being reduced from the reward of the one who acts upon it."
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 6156