Despite this, there is no authentic, explicit text on the matter—namely, his giving the salām along with the imam, or following the takbīrs without making supplication. Rather, it is an exercise of scholarly reasoning on the part of the people of knowledge, may Allah have mercy on them.
Whoever misses the funeral prayer may pray at the grave, and may pray for an absent deceased person by making the intention, for up to one month...
His statement, “Whoever misses the funeral prayer may pray at the grave,” means that he may pray at the grave if the deceased has been buried. Otherwise, he should pray over the deceased without waiting, because prayer at the grave is only permitted out of necessity, when it is not possible for the deceased to be present before him.
The evidence for this is the account of the woman who used to sweep the mosque—that is, remove its refuse and clean it. She died at night, and the Prophet, peace and blessings be upon him, was not informed of her death because they considered her station insignificant, and so as not to cause him hardship. When he asked about her, they told him that she had died. He said, “Why did you not inform me?”—that is, why did you not tell me? Then he said, “Show me her grave.” So he went out in person and prayed at her grave. (1)
This clearly demonstrates the Messenger’s care, peace and blessings be upon him, for people of goodness. Her only deed was that she swept the mosque, even though she was a black woman.
It also demonstrates the Messenger’s care, peace and blessings be upon him, for mosques, as related in the hadith of Aisha, may Allah be pleased with her, that the Prophet, peace and blessings be upon him, “commanded that mosques be built in residential districts, and that they be cleaned and perfumed.” (2)
It also shows the Prophet’s humility, peace and blessings be upon him, in going out to her grave in order to pray for her; otherwise, he could have supplicated for her from where he was.