Fasting in Ramadan and prior to it

Narrated Ibn 'Umar:
The Prophet (S.a.W) observed the fast on the 10th of Muharram ('Ashura), and ordered Muslims to fast on that day, but when the fasting of the month of Ramadan was prescribed, the fasting of the ‘Ashura’ was abandoned. 'Abdullah did not use to fast on that day unless it coincided with his routine fasting by chance. Sahih al-Bukhari 1892; Book 30, Hadith 2; Vol. 3, Book 31, Hadith 116.

Narrated ‘Aisha:
(The tribe of) Quraish used to Fast on the day of Ashura’ in the Pre-Islamic period, and then Allah’s Apostle ordered (Muslims) to fast on it till the fasting in the month of Ramadan was prescribed; whereupon the Prophet (S.a.W) said, “He who wants to fast (on ‘Ashura’) may fast, and he who does not want to fast may not fast.” Sahih al-Bukhari 1893; Book 30, Hadith 3; Vol 3, Book 31, Hadith 117