كتاب الصيام
13  
The Book of Fasting
(35)
Chapter: Prohibition of Fasting for a lifetime for the one who will be harmed by that or who will neglect other duties, or does not break his fast on the two 'Ids or during the days of At-Tashriq; It is better to fast alternate days
(35)
بَاب النَّهْيِ عَنْ صَوْمِ الدَّهْرِ لِمَنْ تَضَرَّرَ بِهِ أَوْ فَوَّتَ بِهِ حَقًّا أَوْ لَمْ يُفْطِرْ الْعِيدَيْنِ وَالتَّشْرِيقَ وَبَيَانِ تَفْضِيلِ صَوْمِ يَوْمٍ وَإِفْطَارِ يَوْمٍ
Sahih Muslim 1159 h

Abdullah b. Amr (Allah be pleased with both of them) reported:

The Messenger of Allah (ﷺ) said to me: 'Abdullah b. Amr, you fast continuously and stand in prayer for the whole of night. If you do like that, your eyes would be highly strained and would sink and lose sight. There is no (reward for) fasting (for him) who fasts perpetually. Fasting for three days during the month is like fasting, the whole of the month. I said: I am capable of doing more than this, whereupon he said: Observe the fast of David. He used to fast one day and break (the other) day. And he did not turn back in the encounter.
وَحَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُعَاذٍ، حَدَّثَنِي أَبِي، حَدَّثَنَا شُعْبَةُ، عَنْ حَبِيبٍ، سَمِعَ أَبَا الْعَبَّاسِ، سَمِعَ عَبْدَ اللَّهِ بْنَ عَمْرٍو، - رضى الله عنهما - قَالَ قَالَ لِي رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ يَا عَبْدَ اللَّهِ بْنَ عَمْرٍو إِنَّكَ لَتَصُومُ الدَّهْرَ وَتَقُومُ اللَّيْلَ وَإِنَّكَ إِذَا فَعَلْتَ ذَلِكَ هَجَمَتْ لَهُ الْعَيْنُ وَنَهِكَتْ لاَ صَامَ مَنْ صَامَ الأَبَدَ صَوْمُ ثَلاَثَةِ أَيَّامٍ مِنَ الشَّهْرِ صَوْمُ الشَّهْرِ كُلِّهِ ‏"‏ ‏.‏ قُلْتُ فَإِنِّي أُطِيقُ أَكْثَرَ مِنْ ذَلِكَ ‏.‏ قَالَ ‏"‏ فَصُمْ صَوْمَ دَاوُدَ كَانَ يَصُومُ يَوْمًا وَيُفْطِرُ يَوْمًا وَلاَ يَفِرُّ إِذَا لاَقَى ‏"‏ ‏.‏
Reference : Sahih Muslim 1159h
In-book reference : Book 13, Hadith 242
USC-MSA web (English) reference : Book 6, Hadith 2592
  (deprecated numbering scheme)