Is Fasting Compulsory?
Question

For whom is fasting Ramadan obligatory?
Praise be to Allah.“Fasting is obligatory for a person if he fulfils five conditions: 

He is a Muslim
He is accountable (mukallaf)
He is able to fast
He is settled (not travelling)
There are no impediments to fasting

If these five conditions are met, then it is obligatory for a person to fast . 

Non-Muslims are excluded from the first condition. The non-Muslim is not obliged to fast and his fast is not valid. If he becomes Muslim, he is not obliged to make up fasts from before. 

The evidence for that is the verse in which Allah says (interpretation of the meaning): 
“And nothing prevents their contributions from being accepted from them except that they disbelieved in Allah and in His Messenger (Muhammad) and that they came not to As-Salah (the prayer) except in a lazy state, and that they offer not contributions but unwillingly” [Al-Tawbah 9:54]
If the contribution is not acceptable even though it benefits others, because of their disbelief, then other acts of worship may be even more unacceptable. 
He does not have to make up fasts if he becomes Muslim because Allah says (interpretation of the meaning): 
“Say to those who have disbelieved, if they cease (from disbelief), their past will be forgiven.” [Al-Anfal 8:38]
And it was proven in mutawatir reports that the Messenger (peace and blessings of Allah be upon him) did not tell those who became Muslim to make up the obligatory duties that they had missed. 

Will the non-Muslim be punished in the Hereafter for not fasting if he did not become Muslim? 

The answer is: 
Yes, he will be punished for not fasting, and for not doing any other obligatory duties, because if the Muslim who obeyed Allah and adhered to His laws will be punished for that, then it is more apt that he (the kafir) should be punished. If the kafir is to be punished for the blessings of Allah that he enjoyed, such as food, drink and clothing, then it is more appropriate that he will be punished for doing haram actions and not doing obligatory duties. This is by way of analogy.  
With regard to the texts, Allah says that those on the Right (i.e., the believers) will say to the disbelievers:  
“‘What has caused you to enter Hell?’
They will say: ‘We were not of those who used to offer the Salah (prayers), Nor used we to feed Al-Miskin (the poor); And we used to talk falsehood (all that which Allah hated) with vain talkers. And we used to belie the Day of Recompense’” [Al-Muddaththir 74:42]
These four things are what will cause them to enter Hell. 
“We were not of those who used to offer the Salah (prayers)” means they did not pray; “Nor used we to feed Al-Miskin (the poor)” means they did not pay zakah; “And we used to talk falsehood (all that which Allah hated) with vain talkers” means things like mocking the verses of Allah;  “And we used to belie the Day of Recompense.” 

The second condition: 

He should be accountable (mukallaf). The one who is mukallaf is one who has reached the age of puberty and is of sound mind, because a minor or one who is insane is not accountable. Puberty is reached when one of three signs is noticed.
The one who is of sound mind is the opposite of one who is insane, which is one who has lost his mind, whether he is insane or feeble-minded. Everyone who has lost his mind, in whatever sense, is not accountable and he is not obliged to do any of the obligatory duties of Islam, be it prayer, fasting or feeding the poor; he does not have to do anything at all. 

The third condition: 

Being able to fast. The one who is unable to fast does not have to fast, because Allah says (interpretation of the meaning): 
“and whoever is ill or on a journey, the same number [of days which one did not observe Sawm (fasts) must be made up] from other days.” [Al-Baqarah 2:185]
But being unable to fast falls into two categories: temporary inability and permanent inability. 
Temporary inability is that which is mentioned in the verse quoted above, such as one who is sick but hopes to recover, and the traveller. These people are allowed not to fast, then they have to make up for what they missed. 
Those who are permanently unable to fast, such as one who is sick and has no hope of recovery, or those who are elderly and are unable to fast, are mentioned in the verse (interpretation of the meaning): 
“And as for those who can fast with difficulty, (e.g. an old man), they have (a choice either to fast or) to feed aMiskin (poor person) (for every day).” [Al-Baqarah 2:184]
As Ibn `Abbas (may Allah be pleased with him) interpreted it, it refers to the old man and old woman who are not able to fast, so they should feed one poor person for each day. 

The fourth condition: 

He should be settled (not travelling). If he is travelling then it is not obligatory for him to fast, because Allah says (interpretation of the meaning): 
“and whoever is ill or on a journey, the same number [of days which one did not observe Sawm (fasts) must be made up] from other days.” [Al-Baqarah 2:185]
The scholars agreed that it is permissible for a traveller not to fast . 
It is better for the traveller to do that which is easier. If fasting is likely to be harmful then it becomes haram to fast, because Allah says (interpretation of the meaning): 
“And do not kill yourselves (nor kill one another). Surely, Allah is Most Merciful to you.” [Al-Nisa 4:29] 
This indicates that whatever is harmful to a person is forbidden to him. 

If you ask, what is the degree of harm which makes fasting haram? 

The answer is: 
Harm may be physical, or someone advises him that fasting may harm him. With regard to physical harm, that means that the sick person feels that fasting is harming him and causing him pain, and will delay his recovery and so on. 
With regard to being advised, this means that a knowledgeable and trustworthy doctor tells him that it will harm him. 

The fifth condition: 

There should be no impediments. This applies specifically to women. Women who are menstruating or bleeding following childbirth should not fast, because the Prophet (peace and blessings of Allah be upon him) said: “Is it not the case that when she gets her period, she does not pray or fast?” 
So she should not fast and her fast is not valid in this case, according to scholarly consensus. And she has to make up for the days missed, also according to scholarly consensus.” (Al-Sharh al-Mumti’, 6/330) 
And Allah knows best.