Al-Adab Al-Mufrad, Book 6, Hadith 13 (In-Book) ⓘ
It is reported that Abu Dharr said, "My dear friend, may Allah bless him and grant him peace, enjoined three things on me: 'Hear and obey, even if the ruler is a slave with his limbs amputated. When you cook a stew, put a lot of water in it and then go and see the people of a neighbouring house and give them a reasonable amount of it. Pray the prayers at their proper prayers. Then if you find that the imam has already prayed, you have guarded your prayer (by already having performed it). If not, it is a supererogatory prayer (since you have done it again)."
حَدَّثَنَا بِشْرُ بْنُ مُحَمَّدٍ، قَالَ: أَخْبَرَنَا عَبْدُ اللهِ، قَالَ: أَخْبَرَنَا شُعْبَةُ، عَنْ أَبِي عِمْرَانَ الْجَوْنِيِّ، عَنْ عَبْدِ اللهِ بْنِ الصَّامِتِ، عَنْ أَبِي ذَرٍّ قَالَ: أَوْصَانِي خَلِيلِي صلى الله عليه وسلم بِثَلاَثٍ: أَسْمَعُ وَأُطِيعُ وَلَوْ لِعَبْدٍ مُجَدَّعِ الأَطْرَافِ، وَإِذَا صَنَعْتَ مَرَقَةً فَأَكْثِرْ مَاءَهَا، ثُمَّ انْظُرْ أَهْلَ بَيْتٍ مِنْ جِيرَانِكَ، فَأَصِبْهُمْ مِنْهُ بِمَعْرُوفٍ، وَصَلِّ الصَّلاَةَ لِوَقْتِهَا، فَإِنْ وَجَدْتَ الإِمَامَ قَدْ صَلَّى، فَقَدْ أَحْرَزْتَ صَلاَتَكَ، وَإِلاَّ فَهِيَ نَافِلَةٌ.
also referenced under: Hadith 113 (Reference) & Book 6, Hadith 113 (English)