كتاب الصيام
13  
The Book of Fasting
(36)
Chapter: It is recommended to fast three days of every month, and to fast on the days of 'Arafah and 'Ashura', and to fast on Mondays and Thursdays
(36)
باب اسْتِحْبَابِ صِيَامِ ثَلَاثَةِ أَيَّامٍ مِنْ كُلِّ شَهْرٍ وَصَوْمِ يَوْمِ عَرَفَةَ وَعَاشُورَاءَ وَالِاثْنَيْنِ وَالْخَمِيسِ
Sahih Muslim 1162 a

Abu Qatada reported that a person came to the Messenger of Allah (ﷺ) and said:

How do you fast? The Messenger of Allah (ﷺ) felt annoyed. When 'Umar (Allah be pleased with him) noticed his annoyance, he said: We are well pleased with Allah as our Lord, with Islam as our code of life, and with Muhammad as our Prophet. We seek refuge with Allah from the anger of Allah and that of His Messenger. 'Umar kept on repeating these words till his (the Prophet's) anger calmed down. Then Umar said: Messenger of Allah, what is the position of one who fasts perpetually? He (ﷺ) said: He neither fasted nor broke it, or he said: He did not fast and he did not break it. 'Umar said: What about him who fasts for two days and does not fast one day? He (ﷺ) said: Is anyone capable of doing that? He ('Umar) said: What is the position of him who fasts for a day and doesn't fast on the other day? Thereupon he (the Holy Prophet) said: That is the fast of David (peace be upon him). He ('Umar) said: What about him who fasts one day and doesn't fast for two days. Thereupon he (the Messenger of Allah) said: I wish I were given the strength to do that. Thereafter he (ﷺ) said: Fasting three days every month and that of Ramadan every year is a perpetual fasting. I seek from Allah that fasting on the day of 'Arafa may atone for the sins of the preceding and the coming years, and I seek from Allah that fasting on the day of Ashura may atone for the sins of the preceding year.
وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى التَّمِيمِيُّ، وَقُتَيْبَةُ بْنُ سَعِيدٍ، جَمِيعًا عَنْ حَمَّادٍ، - قَالَ يَحْيَى أَخْبَرَنَا حَمَّادُ بْنُ زَيْدٍ، - عَنْ غَيْلاَنَ، عَنْ عَبْدِ اللَّهِ بْنِ مَعْبَدٍ الزِّمَّانِيِّ، عَنْ أَبِي قَتَادَةَ، رَجُلٌ أَتَى النَّبِيَّ صلى الله عليه وسلم فَقَالَ كَيْفَ تَصُومُ فَغَضِبَ رَسُولُ اللَّهِ صلى الله عليه وسلم فَلَمَّا رَأَى عُمَرُ - رضى الله عنه - غَضَبَهُ قَالَ رَضِينَا بِاللَّهِ رَبًّا وَبِالإِسْلاَمِ دِينًا وَبِمُحَمَّدٍ نَبِيًّا نَعُوذُ بِاللَّهِ مِنْ غَضَبِ اللَّهِ وَغَضَبِ رَسُولِهِ ‏.‏ فَجَعَلَ عُمَرُ - رضى الله عنه - يُرَدِّدُ هَذَا الْكَلاَمَ حَتَّى سَكَنَ غَضَبُهُ فَقَالَ عُمَرُ يَا رَسُولَ اللَّهِ كَيْفَ بِمَنْ يَصُومُ الدَّهْرَ كُلَّهُ قَالَ ‏"‏ لاَ صَامَ وَلاَ أَفْطَرَ - أَوْ قَالَ - لَمْ يَصُمْ وَلَمْ يُفْطِرْ ‏"‏ ‏.‏ قَالَ كَيْفَ مَنْ يَصُومُ يَوْمَيْنِ وَيُفْطِرُ يَوْمًا قَالَ ‏"‏ وَيُطِيقُ ذَلِكَ أَحَدٌ ‏"‏ ‏.‏ قَالَ كَيْفَ مَنْ يَصُومُ يَوْمًا وَيُفْطِرُ يَوْمًا قَالَ ‏"‏ ذَاكَ صَوْمُ دَاوُدَ عَلَيْهِ السَّلاَمُ ‏"‏ ‏.‏ قَالَ كَيْفَ مَنْ يَصُومُ يَوْمًا وَيُفْطِرُ يَوْمَيْنِ قَالَ ‏"‏ وَدِدْتُ أَنِّي طُوِّقْتُ ذَلِكَ ‏"‏ ‏.‏ ثُمَّ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ ثَلاَثٌ مِنْ كُلِّ شَهْرٍ وَرَمَضَانُ إِلَى رَمَضَانَ فَهَذَا صِيَامُ الدَّهْرِ كُلِّهِ صِيَامُ يَوْمِ عَرَفَةَ أَحْتَسِبُ عَلَى اللَّهِ أَنْ يُكَفِّرَ السَّنَةَ الَّتِي قَبْلَهُ وَالسَّنَةَ الَّتِي بَعْدَهُ وَصِيَامُ يَوْمِ عَاشُورَاءَ أَحْتَسِبُ عَلَى اللَّهِ أَنْ يُكَفِّرَ السَّنَةَ الَّتِي قَبْلَهُ ‏"‏ ‏.‏
Reference : Sahih Muslim 1162a
In-book reference : Book 13, Hadith 252
USC-MSA web (English) reference : Book 6, Hadith 2602
  (deprecated numbering scheme)