O you who believe! Fasting has been ordained for you just as it was ordained for those before you, so that you may attain piety. (Surah Al-Baqarah 183)
This verse announces the obligation of the Ramadhan fasts. Sayyidina Abdullah bin Umar رضی اللہ عنہما narrates that Rasulullah صلی اللہ علیہ وسلم said, Islam is based upon five pillars: (1) The declaration that there is none worthy of worship besides Allah. (2) The establishment of Salah. (3) The payment of Zakah. (4) The performance of Hajj. And (5) Fasting in Ramadhan. (Bukhari v.1 p.6)
Salah and fasting are both physical forms of worship, while zakah involves financial strain. In Hajj, both physical and financial exertions are involved, making it both a physical and financial worship. Salah was made obligatory (Fardh) in the fifth year after prophethood. This transpired in Makkah during the night of Ascension (Mi’raj). The fast in the month of Ramadhan was made obligatory in Madinah during the second year after Hijrah.
Just as Salah and Zakah were obligatory for the previous Ummahs, so too was fasting. This is explained in the phrase where Allah says, “Just as it was ordained for those before you.” Therefore, fasting is nothing new; it should be practiced just as the previous nations did.