Sayyiduna Anas bin Malik (may Allah be pleased with him) narrates: People passed by the Prophet (peace and blessings of Allah be upon him) with a funeral, and its evil was mentioned. The Prophet (peace and blessings of Allah be upon him) said: "It has become obligatory." Then people passed by with another funeral, and the people praised it. The Prophet (peace and blessings of Allah be upon him) said: "It has become obligatory." Sayyiduna Umar (may Allah be pleased with him) asked: "O Messenger of Allah (peace and blessings of Allah be upon him)! What has become obligatory?" The Prophet (peace and blessings of Allah be upon him) said: "These people passed by with him and mentioned his evil, so Hell became obligatory for him. These people passed by with him and mentioned his praise, so Paradise became obligatory for him. You are Allah's witnesses on earth."
Hadith Referenceصحیح ابن حبان / كتاب الجنائز وما يتعلق بها مقدما أو مؤخرا / 3023
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «أحكام الجنائز» (60): ق.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناد صحيح على شرط الشيخين