Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
This is a Fatwa section where we cannot cite all the details about the issue you are asking. However, you may refer to the books that deal with the subject of the biography of the Prophet (Sallallahu Alaihi wa Sallam).
In short, the Prophet (Sallallahu Alaihi wa Sallam) was an orphan and did not learn reading or writing, as it was the custom of Arabs of that period. Generally, they did not learn to read or write, thus they were considered unlettered people. Despite that the Prophet (Sallallahu Alaihi wa Sallam) had high moral standards so that the people of Makkah called him ‘al-Sadiqh’ (the truthful) and ‘al-Ameen’ (the trustworthy). When he was about forty years he used to sit alone in the Hira cave to worship Allah alone. One day the Angel Gabriel came to him with Wahi (inspiration). The first Wahi was the five verses from the chapter No.: 96.
Afterwards Allah ordered him to convey the message to others. Allah Said: {…..Arise and warn!….}[74:2].
The Prophet (Sallallahu Alaihi wa Sallam) began to call people to Tawheed (to worship Allah Alone). When he began his mission the party of Satan also began their work and started to accuse him of many bad things. From what they said is that he was not a Messenger of Allah, rather he was a magician, foreteller, poet, etc. They also said: This (the Qur'an) is not divine but it is the work of a person; some of them claim that Muhammad himself wrote the Qur'an, while some others believe that foretellers and monks dictated the Qur’an to him, etc.
Despite their unrealistic claims Allah made His religion to overcome all other religions and protected His Book. He opened the hearts of people to accept and welcome this religion so that it reached every part of this world. Surely, the time will come when this religion will reach all the corners of the earth: {…..say: "When will that be ?" Say: "Perhaps it is near!"}[17:51].
Allah knows best.