Abu Qatadah reported: The Messenger of Allah, peace and blessings be upon him, said, “The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him.”
Source: Sunan Ibn Mājah 237
Grade: Sahih (authentic) according to Al-Albani
عَنْ أَبِي قَتَادَةَ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ خَيْرُ مَا يُخَلِّفُ الرَّجُلُ مِنْ بَعْدِهِ ثَلَاثٌ وَلَدٌ صَالِحٌ يَدْعُو لَهُ وَصَدَقَةٌ تَجْرِي يَبْلُغُهُ أَجْرُهَا وَعِلْمٌ يُعْمَلُ بِهِ مِنْ بَعْدِهِ
237 سنن ابن ماجه كتاب المقدمة باب ثواب معلم الناس الخير
199 المحدث الألباني خلاصة حكم المحدث صحيح في صحيح ابن ماجه