Mishkat al-Masabih
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.” He transmitted it in al-Muwatta’.
عَنْ مَالِكٍ بَلَغَهُ أَنَّ ابْنَ عُمَرَ كَانَ يُسْأَلُ: هَلْ يَصُومُ أَحَدٌ عَنْ أَحَدٍ أَوْ يُصَلِّي أَحَدٌ عَنْ أَحَدٍ؟ فَيَقُولُ: لَا يَصُومُ أَحَدٌ عَنْ أَحَدٍ. وَلَا يُصَلِّي أَحَدٌ عَنْ أحد. رَوَاهُ فِي الْمُوَطَّأ
Reference