Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ibnmajah:241Ismāʿīl b. Abū Karīmah al-Ḥarrānī > Muḥammad b. Salamah > Abū ʿAbd al-Raḥīm > Zayd b. Abū Unaysah > Zayd b. Aslam > ʿAbdullāh b. Abū Qatādah from his father

"The Messenger of Allah said: 'The best things that a man can leave behind are three: A righteous son who will pray for him, ongoing charity whose reward will reach him, and knowledge which is acted upon after his death.'" (Hasan) Another chain with similar wording.  

ابن ماجة:٢٤١حَدَّثَنَا إِسْمَاعِيلُ بْنُ أَبِي كَرِيمَةَ الْحَرَّانِيُّ حَدَّثَنَا مُحَمَّدُ بْنُ سَلَمَةَ عَنْ أَبِي عَبْدِ الرَّحِيمِ حَدَّثَنِي زَيْدُ بْنُ أَبِي أُنَيْسَةَ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَبْدِ اللَّهِ بْنِ أَبِي قَتَادَةَ عَنْ أَبِيهِ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ خَيْرُ مَا يُخَلِّفُ الرَّجُلُ مِنْ بَعْدِهِ ثَلاَثٌ وَلَدٌ صَالِحٌ يَدْعُو لَهُ وَصَدَقَةٌ تَجْرِي يَبْلُغُهُ أَجْرُهَا وَعِلْمٌ يُعْمَلُ بِهِ مِنْ بَعْدِهِ قَالَ أَبُو الْحَسَنِ وَحَدَّثَنَا أَبُو حَاتِمٍ حَدَّثَنَا مُحَمَّدُ بْنُ يَزِيدَ بْنِ سِنَانٍ الرَّهَاوِيُّ حَدَّثَنَا يَزِيدُ بْنُ سِنَانٍ يَعْنِي أَبَاهُ حَدَّثَنِي زَيْدُ بْنُ أَبِي أُنَيْسَةَ عَنْ فُلَيْحِ بْنِ سُلَيْمَانَ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَبْدِ اللَّهِ بْنِ أَبِي قَتَادَةَ عَنْ أَبِيهِ سَمِعْتُ رَسُولَ اللَّهِ ﷺ فَذَكَرَ نَحْوَهُ