Is it permissible to pronounce Istighfar (seeking forgiveness from Allah) and give Sadaqah (voluntary charity) on behalf of a person who died having abandoned Salah (Prayer),
or who did not offer Salah regularly? Is it permissible to attend that person's funeral and bury them in the graves of the Muslims?
A person who abandons Salah while denying its obligation is considered a Kafir (disbeliever) according to the Ijma` (consensus of scholars). A person who abandons it out of laziness and neglect is also considered a Kafir according to the more correct of the two opinions maintained by scholars. Thus, if a person dies while neglecting Salah intentionally, it is impermissible to ask Allah to forgive them, give Sadaqah on their behalf, attend their funeral, or bury them in the graves of the Muslims. The Prophet (peace be upon him) stated,
The covenant that distinguishes between us and them (the disbelievers) is Salah. Anyone who abandons it has committed Kufr (disbelief).
Ahmad and the compilers of Sunan (Hadith compilations classified by jurisprudential themes) with an authentic Isnad (chain of narrators).
The Prophet (peace be upon him) also stated,
Between a person and Shirk (associating others with Allah in His Divinity or worship) and Kufr (disbelief) is abandoning Salah.
Muslim in his Sahih (authentic) Book of Hadith.
May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.