Anas bin Malik reported,

The Messenger of Allah ﷺ would go without fasting during a month until we thought he would not fast any of it, and he would fast until we thought he would not leave any of it without fasting. You could not wish to see him praying at night without seeing him doing so, nor sleeping without seeing him doing so.Sulayman reported from Humayd that he asked Anas about fasting.

Bukhari 1972

Sahih

حدثني عبد العزيز بن عبد الله قال حدثني محمد بن جعفر عن حميد أنه سمع

أنسا رضي الله عنه يقول

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

البخاري 1972صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Fasting
Chapter
Fasting and breaking of fast of the Prophet ﷺ
Numbering
Darussalam 1972
Bukhari 1972