The last surah revealed was "Baraah" [Tawbah 9], and the last verse revealed was "They ask you for a ruling. Say, Allah gives you a ruling concerning the one who has neither parents nor children" [Nisa 4:176].
آخر سورة نزلت{براءة}، وآخر آية نزلت: {يستفتونك قل الله يفتيكم في الكللة}… [النساء: ١٧٦].
Bukhari related it in the tafsir (4605), and Muslim in the inheritance shares (1618), both from the hadith of Shubah, from Abu Ishaq, who said, "I heard Bara bin Azib say," then he related it.What is meant by "the last" here concerns the matter of inheritance shares.