How to Be Dutiful to Parents in Islam
Question

What forms of ibadah can a child do for his/her parents while they are living and when they have died? Please give examples from the Quran, Sunnah, and practice of the righteous salaf.
Praise be to Allah.Rights of parents in Islam
The rights of parents over their children may be summed up as treating them well in all matters, and behaving with them kindly as Allah says (interpretation of the meaning): 
“And We have enjoined on man to be dutiful and kind to his parents.” [al-Ahqaf 46:15] 
“And We have enjoined on man to be dutiful and kind to his parents.” [al-'Ankabut 29:8] 
“but behave with them in the world kindly.” [Luqman 31:15]
Shaykh al-Sa’di (may Allah have mercy on him) said: “be dutiful and kind to parents” means: treat them kindly in all ways, in word and in deed. (Tafsir al-Sa’di, p. 524) 
How to be dutiful to parents in Islam
Obeying parents
One of the most important acts of worship that the child is asked to do with regard to his parents is to obey them, to do as they ask and to refrain from what they tell him not to do. So if his father tells him to do something, he hastens to do what he is told, and if he tells him not to do something, he hastens to give it up, so long as that does not involve any disobedience towards Allah and his Messenger, because there is no obedience to any created being if it involves disobedience towards the Creator. 
Making du’a for parents
Then he can make du’a for them and pray for forgiveness for them, especially when they grow old and weak and are in need of someone to treat them kindly and take care of their needs . Allah says (interpretation of the meaning): 
“And your Lord has decreed that you worship none but Him. And that you be dutiful to your parents. If one of them or both of them attain old age in your life, say not to them a word of disrespect, nor shout at them but address them in terms of honour. And lower unto them the wing of submission and humility through mercy, and say: ‘My Lord! Bestow on them Your Mercy as they did bring me up when I was young.’” [al-Isra 17:23-24]
Examples of kind treatment of parents in the Quran
 Allah has given examples in His Book of kind treatment of parents . Allah says of His slave Yahya ibn Zakariyya: 
“(It was said to his son): ‘O Yahya (John)! Hold fast the Scripture [the Tawrat (Torah)].’ And We gave him wisdom while yet a child. And (made him) sympathetic to men as a mercy (or a grant) from Us, and pure from sins [i.e. Yahya (John)] and he was righteous, And dutiful towards his parents, and he was neither arrogant nor disobedient (to Allah or to his parents). And Salam (peace) be on him the day he was born, and the day he dies, and the Day he will be raised up to life (again)!” [Maryam 19:12-15]
Ibn Jarir al-Tabari (may Allah have mercy on him) said: 
“Here Allah says: “And dutiful towards his parents” meaning that he was quick to obey them, loving towards them, and not disobedient. 
“and he was neither arrogant nor disobedient” – here Allah tells us that he was not too proud to obey Allah or his parents, rather he was humble and submissive towards Allah and his parents, doing what he was commanded to and avoiding what was forbidden to him; he neither disobeyed his Lord nor his parents.” (Tafsir al-Tabari, 16/58)
And Allah said of His slave ‘Isa ibn Maryam (interpretation of the meaning): 
“He [‘Isa (Jesus)] said: ‘Verily, I am a slave of Allah, He has given me the Scripture and made me a Prophet; And He has made me blessed wheresoever I be, and has enjoined on me Salah (prayer), and Zakah, as long as I live.” And dutiful to my mother, and made me not arrogant, unblest’” [Maryam 19:30-32]
Ibn Kathir (may Allah have mercy on him) said: 
“The words “And dutiful to my mother” mean: and He has commanded me to be dutiful to my mother. This is mentioned after obedience to his Lord, because Allah often mentions the command to worship him and to be dutiful to one’s parents together, as in the verses where He says (interpretation of the meaning): 
“And your Lord has decreed that you worship none but Him. And that you be dutiful to your parents.” [al-Isra 17:23] 
“give thanks to Me and to your parents. Unto Me is the final destination.” [Luqman 31:14] 
And the words “and made me not arrogant, unblest’” mean, ``He has not made me arrogant and too proud to worship and obey Him and to honour my mother, and thus be doomed as a result of that.” (Tafsir Ibn Kathir, 3/121)
How to honor parents after their death
As for after the parents have died, the child can do many things, such as the following: 
1 – If he has wealth, and his parents were in debt, he can discharge their duty by paying off the debt for them . 
2 – If he has wealth and his parents had not performed Hajj, he may perform Hajj on their behalf, or pay for someone else to perform Hajj on their behalf. 
3 – He may pray for forgiveness for them and pray for mercy for them. Allah says (interpretation of the meaning):   
“and say: ‘My Lord! Bestow on them Your Mercy as they did bring me up when I was young.’” [al-Isra 17:24]
Shaykh Ibn Sa’di (may Allah have mercy on him) said: “This means, pray for mercy for them, when they are alive and after they die.” (Tafsir al-Sa’di, p. 524)
Abu Hurayrah narrated that the Prophet (peace and blessings of Allah be upon him) said: “A man may be raised in status in Paradise and will say, Where did this come from? And it will be said: From your son’s praying for forgiveness for you.” Narrated by Ibn Majah, 3660; classed as sahih by al-Albani in Sahih al-Jami’, no. 1617. This applies if the child has reached the age of discernment and is able to earn money. But if the child is young and does not yet understand things, then these words do not apply in his case. 
How the righteous salaf honoured their parents
 An example of how the righteous salaf honoured their parents is that of ‘Abd-Allah ibn ‘Umar (may Allah be pleased with him): 
It was narrated from ‘Abd-Allah ibn Dinar from ‘Abd-Allah ibn ‘Umar that a man from among the Bedouins met him on the road to Makkah. ‘Abd-Allah greeted him with salam, seated him on the donkey that he was riding and gave him a turban that he had been wearing on his head. Ibn Dinar said: We said to him: May Allah guide you, they are just Bedouins and they would be content with little. ‘Abd-Allah said: The father of this man was a friend of ‘Umar ibn al-Khattab and I heard the Messenger of Allah (peace and blessings of Allah be upon him) say: “The best act of kindness is for the son to uphold ties (of friendship) with those who were his father’s friends.” Narrated by Muslim, 2552. 
According to another report narrated by Ibn ‘Umar: when he went out to Makkah, he had a donkey which he would ride when he got tired of riding his camel, and a turban which he tied around his head. One day whilst he was riding that donkey, a Bedouin passed by him. He said: Are you not So and So, the son of So and So? He said: Yes. He gave him the donkey that he was riding and said: Ride it. And he gave him the turban that he had been wearing on his head, and he said: Tie it around your head. Some of his companions said: May Allah forgive you, you have given this Bedouin a donkey that you used to ride when you got tired of riding your camel and a turban that you used to wear on your head. He said: I heard the Messenger of Allah (peace and blessings of Allah be upon him) say: “The best act of kindness is for a man to honour his father’s friend after he has died,” and (this man’s) father was a friend of ‘Umar. 
Abu Hurayrah was appointed in charge of Madinah by Marwan. He lived in Dhu’l-Hulayfah (approximately ten kilometers from Madinah) and his mother lived in one house and he lived in another. When he wanted to go out he would stand at her door, and say: Peace be upon you, O my mother, and the mercy of Allah and His blessings. And she would say: And upon you, O my son, and the mercy of Allah and His blessings. And he would say: May Allah have mercy on you, as you brought me up when I was young. And she would say: May Allah have mercy on you as you took care of me when I grew old. Then when he wanted to come in, he would do likewise. 
And Allah knows best.