Hajj and Fasting are not Accepted from One Who Abandons Prayer
Question :
My mother died a while ago; she never fasted the month of Ramadhan and she only started to pray in the last year of her life. That year, she intended to perform Hajj, but Allâh's decree (her death) came before the Hajj season. Am I allowed to fast for her those months that she didn't, bearing in mind that she did eventually start to pray? Can I perform Hajj on her behalf? Are there other ways or other acts of worship I can perform on her behalf?
Answer:
You are not required to fast the months that she neglected A because not praying is a disbelief that nullifies other deeds due to the saying of the Prophet ﷺ :
"The covenant between us and them is the Salah; whoever leaves it, has disbelieved."
It was recorded by Imam Ahmad and the Sunan compilers from Buraydah bin Al-Hasib, may Allah be pleased with him, with an authentic chain of narration. And there are other authentic Hadiths on this topic.
If, after having been guided to pray, she left some obligatory fasting, you can make it up for her. This is based on the saying of the Prophet ﷺ:
"Whoever dies having some fasting to make up, his Wali (guardian or somebody else responsible) should make up those fasts for him."
It is a Hadith narrated by 'A'ishah, may Allah be pleased with her, and its authenticity is agreed upon.
If nobody not her or her relatives or anybody else - has done it for her, give half a Sa' (a measurement) of the staple food of your country, be it dates, rice, or something else, for each day to a poor person.
It is lawful for you to supplicate for her and give charity on her behalf, in the hope that Allah will benefit her by that, but only if you have no knowledge of her having apostatized before dying. You can also perform Hajj for her, and if she was rich in life, then you are required to perform Hajj from her wealth. I pray that Allah helps and assists you in all that is good.
Source:
Ibn Baz
Fatawa Islamiyah, Vol. 7 Pages 351-352