According to the view of the majority of scholars, reciting a surah is sunnah (1), not obligatory, because nothing is obligatory except the recitation of al-Fatihah.
By saying, “a surah,” the author indicates that what one ought to recite is an entire surah—not part of a surah, nor verses from the middle of a surah—because this was not reported from the Prophet ﷺ. Ibn al-Qayyim stated this without qualification in Zad al-Ma'ad, saying: “As for reciting the ends and the middle portions of surahs, nothing of this has been preserved from him.” However, it is established that the Prophet ﷺ recited verses from surahs in the sunnah prayer before Fajr. At times, in the first rak'ah, he would recite: “Say, ‘We believe in Allah and in what has been revealed to us…’” [al-Baqarah: 136], to the end of the verse; and in the second: “Say, ‘O People of the Book, come to a word that is equitable between us and you…’” [Al 'Imran: 64], to the end of the verse (2). The basic principle is that whatever is established in a voluntary prayer is also established in an obligatory prayer, unless there is evidence to the contrary.
Supporting this principle is the fact that, when the Companions, may Allah be pleased with them, related that the Messenger of Allah ﷺ would perform the witr prayer while riding his mount, they said: “Except that he would not perform the prescribed prayer on it.” Thus, after relating that he would pray witr and then saying, “Except that he would not perform the prescribed prayer on it” (3), this indicates that it was understood that whatever is established in voluntary prayer is established in obligatory prayer.
This is also because they are two acts of worship of the same kind, and the basic principle is that their rulings are the same.