Who Wrote the Quran?
Question

Who wrote the Quran and how was it put together?
Praise be to Allah.Allah promised to preserve the Quran
Allah has guaranteed to preserve this Quran Himself . Allaah says (interpretation of the meaning): 
“Verily, We, it is We Who have sent down the Dhikr (i.e. the Quran) and surely, We will guard it (from corruption)” [al-Hijr 15:9]
Ibn Jareer al-Tabari said in his Tafseer, 14/8: 
“Allah is saying, it is We Who have sent down the Dhikr (Reminder), i.e. the Quran, and We will guard the Quran against anything false being added to it that is not part of it, or anything that is part of it being taken away, whether that has to do with rulings, hudood punishments or matters having to do with inheritance.” 
Al-Sa’di said in his Tafseer (p. 696): 
“It is We Who have sent down the Quran in which there is mention of all issues and clear evidence, and in which We remind those who want to be reminded.  
“and surely, We will guard it” means, when it is being revealed and after it has been revealed. When it is revealed, We protect it from the tampering of every accursed devil, and after it has been revealed Allah instilled it in the heart of His Messenger. Allah protected the words from being changed and from anything being added or taken away, or from its meanings being distorted. So no one can attempt to distort its meanings but Allah will guide someone to explain the truth of the Quran. This is one of the greatest signs of Allah and His blessing to His believing slaves. Another aspect of this protection is that Allah protects the people of the Quran against their enemies, and no enemy can overpower them and eliminate them.”  
The Quran was revealed to the Prophet (peace and blessings of Allah be upon him) in stages over a period of twenty-three years. Allah says (interpretation of the meaning): 
“And (it is) a Quran which We have divided (into parts), in order that you might recite it to men at intervals. And We have revealed it by stages'' [al-Isra’ 17:106]
al-Sa’di (may Allah have mercy on him) said: 
“This means, We have revealed this Quran in stages, to differentiate between guidance and misguidance, between truth and falsehood.
 “in order that you might recite it to men at intervals” means, slowly, so that they may ponder and think about its meanings, and understand the different branches of knowledge contained therein. 
“And We have revealed it by stages” means, gradually, over a period of twenty-three years.” Tafseer al-Sa’di, p. 760. 
Literacy was not widespread among the Arabs 
Literacy was not widespread among the Arabs. Allah described them in such terms when He said (interpretation of the meaning): 
“He it is Who sent among the unlettered ones a Messenger (Muhammad) from among themselves” [al-Jumu’ah 63:2]
They used to memorize the Quran by heart, and a few of them used to write down some verses or surahs on animal skins, thin white stones and the like. 
The prohibition to write anything other than the Quran
At first the Prophet (peace and blessings of Allah be upon him) forbade the writing of anything other than the Quran, and he forbade them to write down his words for a while, so that the Sahabah would focus on memorizing the Quran and writing it down, and so that the words of the Prophet (peace and blessings of Allah be upon him) would not be confused with the words of Allah, and so the Quran was protected from anything being added or taken away. 
The Prophetic order to write down the revelation
The Prophet (peace and blessings of Allah be upon him) appointed a group of his Companions who were trustworthy and knowledgeable to write down the revelation . They are known in their biographies as those who wrote down the Revelation, such as the four Caliphs, ‘Abd-Allah ibn ‘Amr ibn al-‘As, Mu’awiyah ibn Abi Sufyan, Zayd ibn Thabit and others – may Allah be pleased with them all. 
The Quran was revealed in seven dialects
The Quran was revealed in seven dialects as was narrated in the saheeh hadeeth of ‘Umar ibn al-Khattab (may Allah be pleased with him) from the Prophet (peace and blessings of Allah be upon him). This was narrated by al-Bukhari (2287) and Muslim (818); these were the dialects of the Arabs which were known for their eloquence. 
How was the Quran compiled?
The Quran continued to be preserved in the hearts of the Sahabah who had memorized it, and on the skins and other materials until the time of the caliph Abu Bakr al-Siddeeq (may Allah be pleased with him). 
During the Riddah wars many of the Sahabah who had memorized the Quran were killed, and Abu Bakr (may Allah be pleased with him) was afraid that the Quran would be lost. So he consulted the senior Sahabah about compiling the Quran in a single book so that it would remain preserved and would not be lost. He entrusted this mission to the chief of memorizers Zayd ibn Thabit (may Allah be pleased with him). Al-Bukhari narrated in his Saheeh (4986) that Zayd ibn Thabit (may Allah be pleased with him) said:  
Abu Bakr al-Siddeeq sent for me when the people of al-Yamamah had been killed [i.e., a number of the Prophet's Companions who fought against the false prophet Musaylimah]. (I went to him) and found ‘Umar ibn al-Khattab sitting with him. Abu Bakr then said (to me), “ ‘Umar has come to me and said: ‘Casualties were heavy among the Qurra of the Quran (i.e. those who knew the Quran by heart) on the day of the battle of al-Yamamah, and I am afraid that more heavy casualties may take place among the Qurra on other battlefields, whereby a large part of the Quran may be lost. Therefore I suggest that you (Abu Bakr) order that the Quran be collected.” I said to 'Umar, "How can you do something that the Messenger of Allah (peace and blessings of Allah be upon him) did not do?" 'Umar said, "By Allah, this is something good." 'Umar kept on urging me to accept his proposal till Allah opened my heart to it and I began to realize the good in the idea which 'Umar had realized." Then Abu Bakr said (to me). “You are a wise young man and we do not have any suspicion about you, and you used to write the Divine Inspiration for the Messenger of Allah (peace and blessings of Allah be upon him). So search for (the fragmentary scripts of) the Quran and compile it in one book." By Allah If they had ordered me to move one of the mountains, it would not have been heavier for me than this ordering me to compile the Quran. Then I said (to Abu Bakr), "How can you do something that the Messenger of Allah (peace and blessings of Allah be upon him) did not do?" Abu Bakr replied, "By Allah, it is a good thing." Abu Bakr kept on urging me to accept his idea until Allah opened my heart to that to which He had opened the hearts of Abu Bakr and 'Umar. So I started looking for the Quran and collecting it from (what it was written on) palm stalks, thin white stones and also from the men who knew it by heart, until I found the last Verse of Surah al-Taubah with Abu Khuzaymah al-Ansari, and I did not find it with anybody other than him. The verse is (interpretation of the meaning):  
"Verily, there has come unto you a Messenger (Muhammad) from amongst yourselves. It grieves him that you should receive any injury or difficulty...” [al-Taubah 9:128] until the end of Surat Bara'ah (i.e., al-Taubah).  
Then the complete manuscript (copy) of the Quran remained with Abu Bakr until he died, then with 'Umar until the end of his life, and then with Hafsah, the daughter of 'Umar (may Allah be pleased with them). 
The Sahabi Zayd ibn Thabit (may Allah be pleased with him) knew the Quran by heart but he was methodical in his confirmation; he would not agree to write down any verse until two of the Sahabah testified that they had heard it from the Messenger of Allah (peace and blessings of Allah be upon him).  
What was the Quran copy of ‘Uthman?
This Mus-haf (written copy of the Quran) remained in the hands of the caliphs until the time of the Rightly-Guided Caliph ‘Uthman ibn ‘Affan (may Allah be pleased with him). The Sahabah (may Allah be pleased with them) had dispersed to different lands, and they used to recite the Quran according to what they had heard of the seven recitations from the Messenger of Allah (peace and blessings of Allah be upon him), and each of their students used to recite according to what he had heard from his shaykh.
If a student heard someone reciting in a manner different from what he knew, he would denounce him and accuse him of making a mistake, and this went on until the Sahabah feared that there would be fitnah (trouble) between the Tabi'een and successive generations. So they thought that they should unite the people in following one recitation, which was in the dialect of Quraysh in which the Quran had first been revealed, so as to dispel any disputes and resolve the matter. ‘Uthman (may Allah be pleased with him) was consulted, and he agreed with this opinion. 
Al-Bukhari narrated in his Saheeh (4988) from Anas ibn Malik that Hudhayfah ibn al-Yaman came to ‘Uthman at the time when the people of Sham (Syria) and the people of Iraq were waging war to conquer Armenia and Azerbaijan. Hudhayfah was alarmed by their (the people of Sham and Iraq) differences in the recitation of the Quran, so he said to 'Uthman, "O Ameer al-Mu’mineen! Save this nation before they dispute about the Book (Quran) as the Jews and the Christians did before." So 'Uthman sent a message to Hafsah saying, "Send us the manuscript of the Quran so that we may make copies of the Mus-haf and we will return the manuscript to you."  
Hafsah sent it to 'Uthman. Then 'Uthman ordered Zayd ibn Thabit, 'Abdullah ibn al-Zubayr, Sa’eed ibn al-‘As and ‘Abd al-Rahman ibn Harith ibn Hisham to copy out the manuscripts. 'Uthman said to the three men who were from Quraysh (the tribe of which the Prophet (peace and blessings of Allah be upon him) was a member), “In case you disagree with Zayd ibn Thabit on any point in the Quran, then write it in the dialect of Quraysh, for the Quran was revealed in their tongue." They did so, and when they had written many copies, 'Uthman returned the original manuscripts to Hafsah.  
'Uthman sent to every Muslim province one copy of what they had copied, and ordered that all the other Quranic materials, whether written in fragmentary manuscripts or whole copies, be burnt.  
Ibn Shihab said: Kharijah ibn Zayd ibn Thabit told me that he heard Zayd ibn Thabit say: “When we made copies of the Mus-haf I missed a verse of al-Ahzab that I used to hear the Messenger of Allah (peace and blessings of Allah be upon him) recite. So we searched for it and we found it with Khuzaymah ibn Taabit al-Ansari. (The verse was) ‘Among the believers are men who have been true to their covenant with Allah’ [al-Ahzab 33:23 – interpretation of the meaning]. So we put it in its place in its surah in the Mus-haf.”
Thus an end was put to dispute and the Muslims were united. The Quran has remained and will remain narrated from generation to generation and preserved in men's hearts until the Day of Resurrection. This is how Allah has preserved His Book, in confirmation of the verse in which He says (interpretation of the meaning):
“Verily, We, it is We Who have sent down the Dhikr (i.e. the Quran) and surely, We will guard it (from corruption)” [al-Hijr 15:9]
 And Allah knows best.