Muhammad recited this Qur'an to others and in his prayers. Others have done the same ever since, some memorising parts of the Qur'an and others memorising the Qur'an in its entirety. This helped the Qur'an to become unrivalled as a work of its time in terms of the care and effort which were employed to ensure that it would be preserved for all mankind.
Once a part of the Qur'an had been revealed to the prophet (pbuh) he would dictate it to scribes who would make written records of every word recited. These writings would then be read back to the prophet to ensure that they had been correctly recorded. Others around at the time would make their own copies for their private use.
These fragments of revelation came together and were linked into a specific sequence. The sequence defined what is the current ordering of verses in the Qur'an and the prophet (pbuh) affirmed that it was given to him as part of the revelation he received. This sequence was set out through the recitation of Qur'an during prayers and in particular during the month of Ramadan when the prophet (pbuh) would recite the whole of the Qur'an in its correct order.
A year after the prophets death, it was entrusted to a main scribe Zaid ibn Thaabit to assemble these scattered documents on which the verses of the Qur'an were written. He was especially qualified since not only was he a scribe, but he had also memorised the Qur'an completely and was present during the final & complete recitation of the Qur'an by the prophet.
Zaid established and applied a rigorous method of work: he would not accept any writing that was not certified by at least 2 witnesses. The witnesses would have to have seen it being written down, not from memory, but at the very dictation of the prophet (pbuh).
Having completed this task, the collection was given to Abu Bakr - the immediate successor to Muhammad (pbuh) as head of state.
After the collection was made, it was kept & guarded by Abu Bakr and then the following head of state Umar. The next head of state, Uthman, decided to publish it so as to have copies available at the now remote frontiers of the Islamic State. He did this by having four copies made. These copies became the standard against which all other fragments which people possessed were checked. At least one of these Uthmanic copies still exists today.
This compilation of the Qur'an was unanimously recognised as authoritative by the companions of the prophet at the time. It is a strong evidence that for the authenticity of the Qur'an that no other compilation has been used for the 1400+ years since then no matter how implacable certain sections of the Muslims were toward one another.
Variations do exist however in the readings of the text even though there is no dispute about the basic form of the text. These variations come through slight differences in the words due to the old form of written Arabic where diacritical marks (including for example short vowels) were not marked in the written text. This means that there is more than one reading that can fit the text. The prophet explicitly accepted some of these variations as equally valid and acceptable. The exact reading of the text as well as any differing readings were set through oral transmission of the recitation of the Qur'an and through the choice of readings being obvious from the context. The difference in meaning that these differences in readings have is very slight.
The question arises of how reliable the historical reports are. This is not a new question by any standards. Islam had a distinct advantage over previous religions in terms of the ability that the Early Muslims had to preserve the original teachings. The Qur'an was completed in an environment that could not be more different from that of the material that now makes up the Bible. Muslims were not a persecuted community but the rulers of a state that was having military successes on all fronts. This made collection of historical data much easier and establishing the authenticity of various texts clearer.
The laws of the state that emerged from Muhammad's great success as political leader were firmly based on the teachings of Islam. This meant that a great deal of effort went into establishing what the teachings actually were. Indeed this effort was often inspired by a strong religious intention to identify the truth of such matters. This motivation also ensured that clear honesty and objectivity is evident in how the studies were carried out. Whole sciences grew up about which sayings of Muhammad (pbuh) were authentic and which were doubtful. The reports were traced back through the people who narrated them. Some reports were taken form what was written down at the time of Muhammad (pbuh); others proved to be more dubious (the science to identify which were which is called 'uloom ul-hadith). The narrators of the reports of what Muhammad said were investigated to see what their reputation was. For example, it was asked of narrators whether they were ever known to have lied (the study of narrators' reputations is called 'uloom ar-rijaal). Only chains of reporters (isnad) containing just the names of 100% trustworthy narrators were considered reliable enough to use in law making. Hadiths (sayings or narrations) were categorised depending on various criteria including this and many others, which influence the authenticity. Much effort went into this and there is a vast body of literature on the subject.
Of course establishing the exact authenticity of any particular hadith is never 100% possible but at some point the sources are judged to be reasonably sound and reliable and to reject a well-authenticated hadith would be judged unreasonable and therefore wrong.
As for the Qur'an. There has never been any doubt about its authenticity. So many people memorised it by heart and there was from the time of Muhammad a great deal of written material which contained the text of the Qur'an. In all the history of the Qur'an, since Uthman commissioned written copies in the form of Books, there has been one, and only one Qur'an and there have been no changes in it. It is accepted by all Muslims as the exact word of God.
One of the effects of the Qur'an is that huge efforts were also made to preserve the meanings of the Arabic language so that the sources of Islamic law would not get lost through the evolution of the language. This has meant that the classical Arabic can be studied today and modern Arabic is very close indeed to its classical ancestor. The extent to which the Arabic language has remained unchanged for 1400 years show just how significant the source texts of Islam were to the early Muslim generations. These all contribute to proving beyond reasonable doubt that the Qur'an is the same Qur'an that was revealed to Muhammad and that the accounts of his life and his saying are generally very well authenticated and reliable - to an extent probably unlike the accounts of any other character in history.
People bent on denying Islam sometimes try to make challenges to this account of events. However, to do so basically means believing that most if not all the Muslims around throughout the history of Islam were liars - is this reasonable?