What good deeds can I do for my heir who has passed away so that he gets to receive continuous rewards?
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
When a person dies, everything which makes him a human cease and all his deeds are no longer counted except for three matters of which the rewards are continuous even after his death. This is in accordance with a hadith narrated from Abu Hurairah RA, where Rasullullah PBUH said:
إِذَا مَاتَ ابْنُ آدَمَ انْقَطَعَ عَمَلُهُ إِلَاّ مِنْ ثَلاثٍ: صَدَقَةٍ جَارِيَةٍ، أَوْ عِلْمٍ يُنْتَفَعُ بِهِ، أَوْ وَلَدٍ صَالِحٍ يَدْعُو لَه
“When a son of Adam (i.e. any human being) dies his deeds are discontinued, with three exceptions: Sadaqah, whose benefit is continuous; or knowledge from which benefit continues to be reaped, or a righteous child who supplicates for him.” 
Imam al-Nawawi in his syarh stated: Scholars said: This hadith means that the deeds of a person who dies are discontinued due to his death except for three matters which has their own reasons. His child is a result of his efforts, the same for the knowledge he teaches and the charity or wakaf he’d given. Furthermore, there is also an advantage to marriage mentioned and it is to get a pious child. 
According to the above question, there are several deeds that are beneficial to the deceased, among them are give in charity, supplication and hajj for a deceased, all of which the rewards of them will reach the deceased by the will of Allah Taala.
- Supplicating for a deceased
In the Quran, it is stated that believers supplicate for the generation who precedes them in faith:
وَالَّذِينَ جَاءُوا مِن بَعْدِهِمْ يَقُولُونَ رَبَّنَا اغْفِرْ لَنَا وَلِإِخْوَانِنَا الَّذِينَ سَبَقُونَا بِالْإِيمَانِ وَلَا تَجْعَلْ فِي قُلُوبِنَا غِلًّا لِّلَّذِينَ آمَنُوا رَبَّنَا إِنَّكَ رَءُوفٌ رَّحِيمٌ
“And [there is a share for] those who came after them, saying, “Our Lord, forgive us and our brothers who preceded us in faith and put not in our hearts [any] resentment toward those who have believed. Our Lord, indeed You are Kind and Merciful.” 
It is also sunnah to supplicate for a deceased in the funeral prayer. The supplication is:
اللَّهُمَّ اغْفِرْ لَه وَارْحَمْه وَعَافِه وَاعْفُ عَنْه
“O Allah! Forgive him and have mercy on him (on her). Grant him ease and respite.”
اللَّهُمَّ اغْفِرْ لَه وَارْحَمْه وَعَافِه وَاعْفُ عَنْه وَأَكْرِمْ نُزُلَه وَوَسِّعْ مُدْخَلَه واغسله بالماء والثلج والبرد ونقها من الخطايا كَمَا نَقَّيْتَ الثَّوْبَ الْأَبْيَضَ مِنْ الدَّنَسِ وَأَبْدِلْه دَارًا خَيْرًا مِنْ دَارِه وَأَهْلًا خَيْرًا مِنْ أَهْلِه وَزَوْجًا خَيْرًا مِنْ زَوْجِه وَأَدْخِلْه الْجَنَّةَ وَأَعِذْه مِنْ عَذَابِ الْقَبْرِ وَمِنْ عَذَابِ النَّارِ
“O Allah, forgive him and have mercy on him, and give him strength and pardon him. Be generous to him, and cause his entrance to be wide, and wash him with water and snow and hail. Cleanse him of his transgressions as white cloth is cleansed of stains. Give him an abode better than his home, and a family better than his family, and a wife better than his wife. Take him into Paradise, and protect him from the punishment of the grave [and from the punishment of Hell-fire].” 
- Give in charity for him
This is based in a hadith narrated by Aisyah R.Anha, where a man came to meet Rasullullah PBUH:
إِنَّ أُمِّي افْتُلِتَتْ نَفْسُهَا وَلَمْ تُوصِ، وَإِنِّي أَظُنُّهَا لَوْ تَكَلَّمَتْ لَتَصَدَّقَتْ، فَلَهَا أَجْرٌ إِنْ تَصَدَّقْتُ عَنْهَا وَلِيَ أَجْرٌ؟ فَقَالَ: نَعَمْ
“My mother died unexpectedly and she had not made a will. I think that if she could have spoken, she would have given in charity. Will she have a reward if I give in charity on her behalf, and will I have a reward?” He said: “Yes.” 
Imam al-Ramli said: “(Stating that the charity is beneficial for the deceased) for it, and this includes, for example, a wakaf of the mushaf (al-Quran) or others, digging a well, planting a tree from his property when he was alive or after his death using the wealth of others.” 
- Performing hajj
From Buraidah, from his father, a woman asked Rasullullah PBUH regarding her mother who has just passed away:
يَا رَسُولَ اللَّهِ، إِنَّهَا لَمْ تَحُجَّ قَطُّ، أَفَأَحُجُّ عَنْهَا؟ قَالَ: نَعَمْ، حُجِّي عَنْهَا
“She never performed the pilgrimage, so may I do so on her behalf?” He replied, “Yes, perform the pilgrimage on her behalf.” 
This hadith shows that it is permissible to perform hajj for a person who has yet to perform it when he was alive.
In truth, there are several other deeds that a child or heir can do to benefit a deceased. Insya-Allah, we’ll detail it in another answer. We close with the supplication:
اللَّهُمَّ اغْفِرْ لِحَيِّنَا وَمَيِّتِنَا وَصَغِيرِنَا وَكَبِيرِنَا وَذَكَرِنَا وَأُنْثَانَا وَشَاهِدِنَا وَغَائِبِنَا اللَّهُمَّ مَنْ أَحْيَيْتَهُ مِنَّا فَأَحْيِهِ عَلَى الْإِيمَانِ وَمَنْ تَوَفَّيْتَهُ مِنَّا فَتَوَفَّهُ عَلَى الْإِسْلَامِ اللَّهُمَّ لَا تَحْرِمْنَا أَجْرَهُ وَلَا تُضِلَّنَا بَعْدَهُ
“O Allah forgive our living and our dead, those who are with us and those who are absent, our young and our old, our menfolk and our womenfolk. O Allah, whomever you give life from among us give him life in Islam, and whomever you take away from us take him away in Faith. O Allah, do not forbid us their reward and do not send us astray after them.”