Was Prophet Muhammad illiterate?
Prophet Muhammad most likely was not illiterate. This idea seems to have developed later as a pious myth to convey Muhammad's passivity and purity in receiving revelation. It is based on the Qur'an referring to Prophet Muhammad as ummī which is taken to mean illiterate.
...Believe then in God, and in His Messenger, the ummī Prophet. (Qur'an 7:158)
However, the Qur'an also refers to the community that Muhammad was a part of as ummiyīn:
It is He who has sent among the Ummiyyīn a Messenger from themselves reciting to them His verses and purifying them and teaching them the Book and wisdom - although they were before in clear error. (Qur'an 62:2)
There were clearly at least some people in Muhammad's community who could read and write. For example, the Prophet would have scribes write down some of his divinely inspired recitations ( qur'ans). This further invalidates the idea that ummī and ummiyīn mean illiterate.
A close analysis of the word ummī and its cognates that show up in Islamic traditions shows that it does not mean illiterate but rather Gentile (non-Jewish).
'Scholarship on the meaning and origins of this term, however, is an exceptional case in that it virtually unanimously rejects the mainstream traditional interpretation of the phrase nabī ummī as “illiterate prophet.”'
- Mehdy Shaddel, Qurʾānic ummī: genealogy, ethnicity, and the foundation of a new community , p. 1
If there is any truth to the notion that the Prophet was illiterate, based on traditional understanding of the word ummī that developed over time, then this has not to do with the Prophet's ability to read and write in the ordinary sense. In fact, Ismaili esoteric hermeneutics reveals a deeper understanding of the word ummī and to what it refers: Commenting on the above-mentioned Qur'an 62:2, Nasir Khusraw says by ummī it is meant that Prophet Muhammad was unable to read the divine writing (kitab ilahi) until he received the divine inspiration (wahy) in his heart:
"In this verse, it is also found that before attaining wahy [divine inspiration], the Messenger was also ummī. Ummī means that the Messenger was unable to read the Divine Writing (neveshteh ilahi; kitabat ilahi). So we say that all the people are "ummī" (unable to read) the Divine Writing and the Messenger before the Holy Spirit conjoined to him was also "ummī" of the Divine Writing."
- Nasir-i Khusraw, Zad al-Musafirin, p. 215-216