The Messenger of Allah ﷺ said, "The example of the son of Adam and his wealth, his children, and his deeds is like that of a man who had three friends.One of them said to him, 'I am with you as long as you are alive, but when you die, you are no longer mine and I am no longer yours.' That is his wealth.The second said, 'I am with you, but when you reach your grave, I am no longer yours and you are no longer mine.' That is his children.The third said, 'I am with you in life and in death.' That is his deeds."
قال رسول الله ﷺ: مثل ابن آدم وماله وولده وعمله مثل رجل له ثلاثة أخلاء، قال له أحدهم: أنا معك ما دمت حيا، فإذا مت فلست مني ولا أنا منك، فذلك ماله، وقال الآخر: أنا معك، فإذا بلغت إلى قبرك فلست مني ولست لك، فذلك ولده، وقال الآخر: أنا معك حيا وميتا، فذلك عمله.
No references are available.
Bazzar (8356), Abu Shaykh in al-Amthal (309), and Bayhaqi in al-Shuab (9993) all narrated it through the route of Abu Asim, that is, Dahhak bin Makhlad al-Nabil ﷺ, he said, Muhammad bin Ajlan narrated to us, from his father, from Abu Hurairah, and he related it. Its chain is hasan because of Muhammad bin Ajlan and his father, for both of them narrate hasan hadiths.