The Quran says: God asserts the fact that no soul will be accountable to the sins of another, and equally that no soul will be credited from the deeds of another. In other words, each soul will be held accountable only to what it has done.
“Every soul is responsible only for his/her own work” 53:39
“……….. no soul benefits except from its own work …..” 6:164
Hadith attributed to the prophet:
In spite of these firm assurances from God, there are hadith that quote the prophet declaring that one can observe Hajj on behalf of others (whether they are dead or alive)! and that one can give Zakat on behalf of them and also fast on behalf of them! In other words, these hadith cancel all the content of 53:39 and 6:164 and declares that despite what these Quranic ayat say that one can still benefit and be credited on Judgement Day from the work of another!
Bukhari, Volume 2, Book 26, Number 589:
Narrated ‘Abdullah bin Abbas:
“Al-Fadl (his brother) was riding behind Allah’s Apostle and a woman from the tribe of Khath’am came and Al-Fadl started looking at her and she started looking at him. The Prophet turned Al-Fadl’s face to the other side. The woman said, “O Allah’s Apostle! The obligation of Hajj enjoined by Allah on His devotees has become due on my father and he is old and weak, and he cannot sit firm on the Mount; may I perform Hajj on his behalf?” The Prophet replied, “Yes, you may.” That happened during the Hajj-al-Wadaa (of the Prophet ).”
The obvious question here is: would the prophet of God teach what is in violation to the message of the Quran? Would God present a rule in the Quran only for it to be contradicted by His loyal prophet?