It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Pray behind every righteous and wicked person, offer the funeral prayer over every wicked and righteous person, and wage jihad alongside every righteous and wicked person."
Ali (al-Daraqutni) says: Makhul did not hear from Abu Hurayrah, and those below him are thiqat (trustworthy). Al-Shaykh says: Regarding the funeral prayer over every righteous and wicked person, and the funeral prayer over whoever said 'La ilaha illallah' (There is none worthy of worship except Allah), hadiths have been narrated which are all extremely weak; the most authentic of what has been narrated on this subject is the hadith of Makhul from Abu Hurayrah, which Abu Dawud recorded in his Sunan, except that there is irsal (a missing link) in it, as al-Daraqutni (may Allah have mercy on him) mentioned.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6832
Sayyiduna Jabir bin Samurah (may Allah be pleased with him) narrates that a man who had killed himself with an arrowhead was brought to the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) did not offer his funeral prayer.
Ahmad bin Yunus, in a narration, states that a man fell ill and people cried out over him. A man came to the Messenger of Allah (peace and blessings be upon him) and said: That man (the sick one) has died. He (peace and blessings be upon him) said: "What makes you know?" He said: People have cried out over him. He (peace and blessings be upon him) said: "He has not died." Then the man went to see, and he saw that he had slaughtered himself with an arrowhead. Then he went to inform him (peace and blessings be upon him) that he had died. He (peace and blessings be upon him) asked: "How do you know?" He said: I saw that he had killed himself with an arrowhead. So he (peace and blessings be upon him) said: "Then I will not offer his funeral prayer."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6833