صحيح مسلم Sahih Muslim كتاب الصيام The Book of Fasting
باب نُدْبِ الصَّائِمِ إذَا دُعِيَ إِلَي الطَّعَامِ وَلَمْ يُرِدِ الْإِفْطَارَ ، أَوْ شُوتِمَ أَوْ قُوتِلَ أَنْ يَقُولَ : إِنِّي صَائِمٌ وَّأَنَّهُ يُنزِّهُ صَوْمَهُ عَنِ الرَّفَثِ وَالْجَهْلِ وَنَحْوِهِ

Chapter: If a fasting person is invited to eat and he does not want to break his fast, or someone insults him or argues with him, it is recommended for him to say: "I am Fasting", and he should protect his fast from obscene speech, ignorance and the like

1 hadith
Hadith 1150
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ ، وَعَمْرٌو النَّاقِدُ ، وَزُهَيْرُ بْنُ حَرْبٍ ، قَالُوا : حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ ، عَنْ أَبِي الزِّنَادِ ، عَنِ الْأَعْرَجِ ، عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ ، قَالَ : يَبْلُغُ بِهِ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، وقَالَ زُهَيْرٌ : عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، قَالَ : " إِذَا دُعِيَ أَحَدُكُمْ إِلَى طَعَامٍ وَهُوَ صَائِمٌ ، فَلْيَقُلْ إِنِّي صَائِمٌ " .
Abu Hurairah (RA) reported Allah's Apostle (ﷺ) as saying: If any one of you is invited to a meal when he is fasting, he should say: "I am fasting."
Hadith Reference Sahih Muslim / The Book of Fasting / Hadith: 1150
Hadith Grading محدثین: أحاديث صحيح مسلم كلها صحيحة
Hadith Takhrij «أحاديث صحيح مسلم كلها صحيحة»