The observation of Ramadan is mandated by two Islamic sources, Al-Qur'an and Sunnah, along with Ijmaa, the consensus of the scholars. Al-Qur'an states: "O, you who believe fasting is prescribed to you, as it was prescribed to those before you that you may acquire self-restraint." (Al-Qur'an 2:183)
The proof in this citing is very obvious, for whenever Allah (SWT) uses the word kutiba, which means, among other things, prescribed or written, it indicates the action that follows it becomes mandatory upon the believers, men, and women. After establishing Sawm, the verse emphasized that this was not the first time the obligation of fasting had been established, for it stated that previous nations received the same mandate. We are not certain about the time, date, and amount.
Many scholars state the introductory clause kamaa implies and refers to the analogy between our fasting today and the fasting of previous people. There are similarities in the time and amount, but what happened to Ramadan is that the high priests, before the time of Prophet Muhammad (saas) added more days than were prescribed for them. It became difficult and they could not do it, so they moved the date to spring until they neglected it altogether.
Some said the analogy is referring to the manner of fasting - restraint from food and drink and marital relations. The verse ends with a strong hint at the spiritual benefit of fasting: "That ye may acquire self-restraint." The word used is tataqun. It is originally from waqa, to protect, the same base word used for fear of Allah, taqwa; for when you fear Allah, you protect yourself against His wrath and against things that will destroy yourself.
Taqwa (fear of Allah), is easily achieved with fasting for the simple reason that, when you fast, you become weak of the lack of nourishment, which means your cravings are diminished. With diminished cravings, the sins are greatly lessened, because there is no energy to fuel them, praise be to Allah. When sin is lessened, the barometer for taqwah rises.
Elsewhere Allah (SWT) states: "Ramadan is the month which was sent down the Qur'an as a guide to humanity and as a clear sign for guidance and judgment (between right and wrong). So anyone of you who witnesses the month should spend it in fasting..." (Al-Qur'an, 2:185)
This verse contains important rules and reasons for fasting that will be explained later. However, what concerns us here is the statement, "So anyone of you who witnesses the month should spend it in fasting." There are exceptions, like when traveling, which will be explained later.
The above examples have been the proof from Al-Qur'an. As for the proof from hadith, there are many, amongst them a hadith reported by Bukhari and Muslim in which the Messenger (saas) states: "Islam is built on five (pillars), testimony that there is no deity worthy of worship but Allah, and testimony that Muhammad is His messenger, establishing Salat, giving Zakat, observing the fast of Ramadan, and pilgrimage to the House of Allah." (Bukhari/Muslim)
The hadith established fasting during the month of Ramadan as one of the pillars on which this religion is built. This hadith reinforces the obligation of fasting as stated in Al-Qur'an. We will see later that there are other Hadiths that explain in detail how to observe the 'Ebadah, the worship of fasting.
Because of this collection of proofs from both Al-Qur'an and the Sunnah, the Muslim scholars agreed in Ijima'a that abstinence from physical nourishment and sex associated with intention to seek Allah's pleasure is mandatory upon every believer. Before verse (2:185) was revealed, Muslims were commanded to fast three days in every month (verse 2:183). This verse (2:185) was revealed on Monday, Sha'aban 2, in the second year of Hijrah, thus, abrogating the earlier order.