[2][4][5] In 1907 or 1908 (1325 AH), he commenced the study of Urdu, Persian, mathematics and other subjects at Darul Uloom Deoband, which he completed within the next five years under the supervision of his father.
[1][2] He studied arithmetic and Euclid from his uncle Munshi Manzur Ahmad and Quranic recitation from Muhammad Yusuf Miruthi.
Shafi studied Sahih Muslim and half of Hidayah with Shabbir Ahmad Usmani, whom he would later accompany in the movement to create Pakistan.
With Azizur Rahman, head of the Darul Uloom's Fatwa Department, Shafi studied the Muwatta of Imam Malik in the transmission of Yahya ibn Yahya and the transmission of ash-Shaybani, at-Tahawi's Sharh Ma'ani al-Athar, Tafsir al-Jalalayn, Mishkat al-Masabih, Ibn Hajar's Sharh Nukhbat al-Fikar, and Hisn-i Hasin.
In 1354 AH (1935/1936) he was entrusted with teaching Sunan Abu Dawud for some time in place of Maulana Asghar Husain.
Shafi was regarded as an exceptional lecturer on many subjects, but two of his lessons were most famous—one was Sunan Abu Dawud, and the other was Maqamat al-Hariri in Arabic literature.
[2] After leaving Darul Uloom Deoband, he taught Sahih al-Bukhari for three months at Jamiah Islamiyah Dabhel, filling in for Maulana Shabbir Ahmad Usmani.
[5] In November 1932 (Rajab 1351), Shafi published a tract entitled Nihayat al-arab fi ghayat an-nasab on caste.
Due to the controversy, Shafi asked to be transferred to the teaching department, a request that was eventually granted by the Majlis-e-Shura in Sha'ban 1354 AH (c. November 1935).
Some of Muhammad Shafi's fatwas have been published in eight large volumes titled Imdad al-Muftin, while the majority remain unpublished.
In Rabi ath-thani 1349 AH (1930) he received ijazat-i bay'at (permission to take disciples) and khilafah (spiritual successorship).
In 1363 AH (1944) Muhammad Shafi resigned from teaching and issuing fatwas at Darul Uloom Deoband in order to devote his time to the movement for the creation of Pakistan.
His best-known and most widely translated work is the Ma'ariful Qur'an ("The Wisdom of the Quran"), which he finished (in Urdu) four years before his death.
[9] This work, a commentary on the entire Quran, began as a series of weekly lectures on Radio Pakistan that ran for ten years.