Fasting in Ramadan is an obligation upon every accountable Muslim, and no one is excused from fasting at the time of fasting except for those who have valid excuses such as the sick, travelers, pregnant and breastfeeding women, the very old and those who are forced to break their fast. Most of the scholars are of the opinion that if the pregnant and breastfeeding women fear for themselves, then they should not fast, but they have to make up for the days they miss.
Dr. Muzammil H. Siddiqi, former President of the Islamic Society of North America, states the following:
“If the pregnant and breastfeeding women fear for themselves, then most of the scholars say that they should not fast, and they only have to make it up. In this case they are similar to the sick.
But for the pregnant woman who fears for the foetus or the breastfeeding woman who fears for the child, it is unanimously agreed that they are not to fast. The scholars have differed on if she has to make it up, or if she just has to feed a poor person for each day, or if she has to do both.
The majority of scholars say that she is to make it up, while Ibn `Umar and Ibn `Abbas (may Allah be pleased with them) say that she is to feed a poor person, and the others say that she is to do both. But it appears to me that it is permissible to feed a poor person instead of making it up, especially with regards to the woman who is constantly pregnant or breastfeeding and would not find a chance to make it up. One year she would be pregnant, the next year she would be breastfeeding, the next she would be pregnant and so on. She would constantly be either pregnant or breast-feeding to the extent that she would not be able to make anything up. And if we burdened her to make up all the days she did not fast because of pregnancy or breastfeeding, then that would mean that she would have to fast a number of continuous years after that. This has in it a great hardship, and Allah does not wish for His worshipers to be in hardship.”