It is narrated from Nafi' (may Allah have mercy on him) that Ibn Umar (may Allah be pleased with him) used to say: Whoever has performed the Maghrib and Fajr prayers, and then joins these prayers with the Imam as well, he should by no means repeat them.
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 280
Hadith Takhrijصحیح، اخرجہ عبدالرزاق: 3939، 3940، وابن ابی شیبة: 6663، والبیہقی فی المعرفة السنن والآثار: 1073۔