The Prophet ﷺ said, "When one of you is invited to a meal while fasting, let him say, 'I am fasting.'"
حدثنا أبو بكر بن أبي شيبة ومحمد بن الصباح قالا حدثنا سفيان بن عيينة عن أبي الزناد عن الأعرج
عن النبي ﷺ قال إذا دعي أحدكم إلى طعام وهو صائم فليقل إني صائم
Muslim reported it in Sahih Muslim, Fasting, chapter on the recommendation for a fasting person invited to a meal, but not intending to break his fast, and so on, hadith no. 1150, from Abu Bakr bin Abu Shayba and others, with this wording.