The Prophet ﷺ never fasted a complete month other than Ramadan. He would fast until one would say, "By Allah, he will not break his fast," and he would go without fasting until one would say, "By Allah, he will not fast."
ما صام النبي ﷺ شهرا كاملا قط غير رمضان، ويصوم حتى يقول القائل: لا والله لا يفطر، ويفطر حتى يقول القائل: لا والله لا يصوم.
Bukhari narrated it in the Book of Fasting (1971), and Muslim in the Book of Fasting (1157), both through the route of Abu Awana, from Abu Bishr, from Saeed bin Jubayr, from Ibn Abbas, and he related it. Ahmad (2947) also narrated it through this same route. Abu Dawud (2430) narrated it through the route of Uthman bin Hakeem, who said, "I asked Saeed bin Jubayr about fasting in Rajab," and he said, "Ibn Abbas told me," and he related it. Its chain of transmission is also sahih, except that Abu Bishr, who is Jafar bin Iyas, is among the most reliable narrators from Saeed bin Jubayr, and his version of the hadith does not contain the question about fasting in Rajab.