It is narrated from Sayyiduna Amir bin Rabi'ah (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) passed by a fresh grave and said: "Whose grave is this?" The people said: "It is the grave of so-and-so (a woman)." He (peace and blessings be upon him) said: "Why did you not inform me?" They said: "O Messenger of Allah! You were asleep, and we disliked waking you." He (peace and blessings be upon him) said: "Do not do that; inform me of your funerals." Then he (peace and blessings be upon him) stood up, arranged the rows and led the funeral prayer over that woman.
Imam Ahmad (may Allah have mercy on him) narrated it through Qutaybah bin Sa'id from Abd al-Aziz al-Darawardi with a similar meaning.
And Imam Ibn Majah (may Allah have mercy on him) narrated it through Ya'qub bin Humayd bin Kasib from al-Darawardi with a similar meaning.
Imam al-Bukhari and Imam Muslim (may Allah have mercy on them both) narrated through al-Sha'bi (may Allah have mercy on him) from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) came to a fresh grave and offered the funeral prayer over it; the people formed rows behind him (peace and blessings be upon him), and he (peace and blessings be upon him) said four takbirs. These are the words of Imam Muslim (may Allah have mercy on him).
The two of them also narrated through Abu Rafi' (may Allah have mercy on him) from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that a black woman (or a young man) used to sweep the mosque. The Messenger of Allah (peace and blessings be upon him) missed her and asked about her. The people said: "She has died." He (peace and blessings be upon him) said: "Why did you not inform me?" The narrator said: It was as if the people had regarded her matter as insignificant. Then he (peace and blessings be upon him) said: "Show me her grave." They showed him (peace and blessings be upon him) the grave, and he (peace and blessings be upon him) offered the funeral prayer over her, then said: "These graves are filled with darkness for their occupants, and Allah, the Mighty and Majestic, illuminates them for them by my prayer over them."