What is the ruling on fasting with the intention of fasting both for medical reasons and fasting in the Islamic sense?
Question

There is something called “water fasting” where you only drink water for a couple of days. This can be from 3 days to 10 days or even more. It is known to have many health benefits. Does this go under continual fasting if I intend to do this fast religiously by only drinking water (no food) for sahur and iftar? Is it permissible? Also, since bowel movements are disrupted during this fast, doing enema is recommended every few days. Is this permissible? I would like to add that I do not have any health problem, I just want to gain the health benefits this fast has to offer.
Praise be to Allah.Firstly:
Combining the intention of seeking reward for fasting and of achieving health benefits
If someone fasts for the sake of Allah, may He be exalted, and at the same time also intends to attain the health benefits of fasting, there is nothing wrong with that. Seeking permissible benefits does not invalidate an act of worship, just as Allah, may He be exalted, has permitted the pilgrim to engage in trade and seek the provision of Allah during his Hajj journey.
Allah, may He be exalted, says (interpretation of the meaning):
{Hajj is [during] well-known months, so whoever has made hajj obligatory upon himself therein [by entering the state of ihram], there is [to be for him] no sexual relations and no disobedience and no disputing during hajj. And whatever good you do - Allah knows it. And take provisions, but indeed, the best provision is fear of Allah. And fear Me, O you of understanding 
There is no blame upon you for seeking bounty from your Lord [during hajj]. But when you depart from 'Arafat, remember Allah at al- Mash‘ar al-Haram. And remember Him, as He has guided you, for indeed, you were before that among those astray} [al-Baqarah 2:197-198].
It was narrated that Ibn ‘Abbaas (may Allah be pleased with him) said: Dhu’l-Majaaz and ‘Ukaaz were markets that were held during the Jaahiliyyah. When Islam came, it was as if they had reservations about that, until the words were revealed: {There is no blame upon you for seeking bounty from your Lord [during hajj]}. Narrated by al-Bukhaari (1770), who included it in a chapter entitled: Chapter on trade during the days of Hajj and buying and selling in the markets of the Jaahiliyyah.
Similarly it is permissible for a young man to fast with the intention of suppressing and reducing his desire.
It was narrated that ‘Abdullah ibn Mas‘ood (may Allah be pleased with him) said: The Prophet (blessings and peace of Allah be upon him) said to us: “O young men, whoever among you can afford it, let him get married, for it is more effective in lowering the gaze and guarding one’s chastity. And whoever cannot afford it should fast, for it will weaken his desire.” Narrated by al-Bukhaari (5066) and Muslim (1400).
For more information, please see the answer to question no. 220996 .
But the one who fasts should make worship his main focus, and not the opposite, as has been explained previously in the answer to question no. 228454 .
Secondly:
What is the continuous fasting that is not allowed?
The continuous fasting that is not allowed is when the fasting person continues to fast night and day for a number of days, without eating or drinking, and without eating sahoor or iftar. If the fasting person has iftar or sahoor, even if it is only water, then he is not regarding as fasting continuously. Please see the answer to question no. 37757 .
As this is the case, then fasting in the sense of refraining from eating food and drinking only water is not a type of fasting that is prescribed in Islam at all, let alone being a kind of continual fasting, because there is no fasting in this case, so long as one is drinking water.
But it should be noted that refraining from eating food in this manner, even though it  does not come under the heading of continual fasting, if it leads to falling short in obligatory duties, such as feeling too lazy to offer the five daily prayers, or it leads to falling short in doing one’s duties to other people, such as falling short in doing one’s job, then this kind of refraining from eating or “fasting” is not allowed.
If it is done for a real medical need, and it will not prevent one from carrying out Islamic duties or duties towards other people that outweigh the interest served by this “fasting”, as is done by some religiously committed people, then it is not disallowed. But one should bear in mind what has been noted above, that this is not a real fast (sawm) and one cannot draw closer to Allah by doing such things. Rather it comes under the heading of medical treatment and remedies, like other kinds of medical treatment.
Thirdly:
Ruling on doing an enema when fasting
The scholars differed regarding the ruling on doing an enema when fasting and whether it invalidates the fast or not. The view that is more likely to be correct is that it does not invalidate the fast. This has been discussed previously in a number of answers. Please see the answers to questions no. 38023 and 37749 .
This ruling has nothing to do with the one who is refraining from eating food only, because he is not fasting in the Islamic sense, so if he has a medical need for an enema, there is no reason not to do it.
And Allah knows best.