The last surah revealed was Baraah, and the last verse revealed was "They ask you for a ruling" [Nisa 4:176].
آخر سورة نزلت: (براءة). وآخر آية نزلت: {يستفتونك}.
Bukhari narrated it in the tafsir (4605), and Muslim in the inheritance shares (1618), both from the hadith of Shubah, from Abu Ishaq, "I heard Bara," and he related it.