Sunan Ibn Majah (Ibn Majah 241)

'Abdullah bin Abu Qatadah narrated that his father said:

"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.