Malik said he heard that Ibn ‘Umar used to be asked whether one might fast or pray on behalf of another, and reply, “One may neither fast nor pray on behalf of another.”
Nafi‘, on Ibn ‘Umar’s authority, reported the Prophet as saying, “If anyone dies when fasting in the month of Ramadan has been unfulfilled by him, a poor man should be fed on his behalf in place of every day.”
Tirmidhi transmitted it, saying that correctly this goes no farther back than Ibn ‘Umar.
‘A'isha said, "God’s messenger used to fast to such an extent that we thought he would never break his fast, and he would go without fasting to such an extent that we thought he would never fast. I never saw God’s messenger fast a complete month except in Ramadan, and I never saw him fast more in any month than in Sha'ban." In a version she said he used to fast the whole of Sha'ban, i.e. he would fast all but a little of Sha'ban.