What is the ruling on fasting?
Fasting in Ramadan is an individual obligation (Fard ‘Ayn) upon every mature, sane Muslim who is capable of fasting.
Fasting can also be recommended (Mustahabb), such as voluntary fasting on Mondays and Thursdays, fasting on the Day of Arafah for those not performing Hajj, and fasting on Ashura.
Fasting can be prohibited (Haram), such as fasting on the two Eid days, the Day of Doubt (Yawm al-Shakk), and the Days of Tashreeq.
Some types of fasting are disliked (Makruh), such as singling out Friday or Saturday for fasting without a specific reason and fasting on the Day of Arafah for a pilgrim.
Does undergoing an endoscopy during the day in Ramadan affect the validity of fasting?
Undergoing an endoscopic procedure during the day in Ramadan—whether through the mouth, nose, front private part, or back private part—invalidates the fast.
Whoever undergoes such a procedure must refrain from eating and drinking for the rest of the day out of respect for the sacred month and make up for that day after Ramadan.
What is the ruling on reciting the takbīr from Sūrat aḍ-Ḍuḥā to Sūrat an-Nās upon completing the recitation of the Qur'an (khatm)?
All praise is due to Allah, and peace and blessings be upon our master, the Messenger of Allah ﷺ.
It is recommended to recite the takbīr from the beginning of Sūrat aḍ-Ḍuḥā through to the end of Sūrat an-Nās, and this is the recitation practice of the people of Makkah.
It is stated in Nihāyat az-Zayn (p. 65): "It is sunnah to begin each sūrah with the basmalah, since it constitutes a verse of it. It is also sunnah to say, before each sūrah — from aḍ-Ḍuḥā to the end of the Qur'an — 'Lā ilāha illallāh, wallāhu akbar' (There is no god but Allah, and Allah is the Greatest), based on what has been narrated regarding Imam ash-Shāfi‘ī (raḍiyallāhu ‘anh), who heard a man reciting this takbīr in prayer, and said to him: 'You have done well, and you have hit upon the sunnah.'"
And Allah, the Exalted, knows best.
What is the ruling on eating or drinking forgetfully during the day in Ramadan or during voluntary fasting?
Whoever eats or drinks forgetfully while fasting, whether in an obligatory or voluntary fast, should continue their fast, for it is Allah who has provided them with food and drink. There is no difference between obligatory and voluntary fasting in this ruling.