Performing Prayers in congregation is a confirmed Sunnah. Many hadiths discuss the virtue and importance of performing Prayers in congregation. Ibn `Umar quoted the Prophet (peace and blessings be upon him) as saying: “The reward of Prayer performed congregation outweighs that of Prayer performed individually by twenty-seven degrees.” (Al-Bukhari and Muslim)
It is obligatory to follow the imam while performing behind him as the imam is selected to be followed.
Elaborating more on this, we we cite what Sheikh Sayyed Sabiq states in his well-known book, Fiqh Us-Sunnah:
Abu Hurayrah reported that the Prophet (peace and blessings be upon him) said, “The imam is selected to be followed; therefore, do not differ with him. When he makes the takbir, make the takbir, when he goes into ruku`, make ruku`. When he says ‘Allah hears him who praises Him,’ say ‘O Allah, our Lord, to You belongs the Praise.’ When he goes into sajdah, make sajdah. If he prays sitting, then all should be sitting” (reported by the group). In the version by Ahmad and Abu Dawud, the wording is “The imam is to be followed. If he makes the takbir, make the takbir, and do not make the takbir until he does so. When he goes into ruku`, make ruku`, and do not perform ruku` until he does so. When he goes into sajdah, make sajdah, and do not make sajdah until he does so.”
Abu Hurayrah reported that the Prophet (peace and blessings be upon him) said, “Do you not fear that if you raise your head before the imam Allah may change your head into that of a donkey!” (reported by the group).
Anas reported that the Messenger of Allah (peace and blessings be upon him) said, “O people, I am your imam, so do not precede me in ruku` or in sujjud or in qiyam or in sitting or in finishing” (Ahmad and Muslim).
Al-Bara’ ibn `Azib said, “We prayed with the Messenger of Allah and when he said ‘Allah hears him who praises Him,’ none of us would bend his back [to prostrate] until the Messenger of Allah had put his forehead upon the ground” (reported by the group).