Anas bin Malik reported,

The Messenger of Allah ﷺ would go without fasting in a month until we thought he would not fast at all that month, and he would fast until we thought he would not break his fast at any point in it. And during the night, you would not wish to see him praying except that you saw him doing so, nor sleeping except that you saw him doing so.

Azami 4420

Sahih

عن أنس بن مالك، قال

كان رسول الله ﷺ يفطر من الشهر حتى نظن أن لا يصوم منه، ويصوم حتى نظن أن لا يفطر منه شيئا، وكان لا تشاء تراه من الليل مصليا إلا رأيته، ولا نائما إلا رأيته.

الأعظمي 4420صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Voluntary fasting and encouragement to do it
Section
How did the Prophet ﷺ fast outside of Ramadan?
Numbering
Jami al-Kamil 4420 (2nd edition)