As usual, the women rights in Islam is echoed in almost every other aspect dealing with them. One has to have an open heart and mind to comprehend it. Allah in his mercy has waived or exempted the pregnant and breast feeding women from the obligation of fasting that was imposed even on jews and christians before in their respective era of prophets. This shows how much Islam cares for the woman's health and even her unborn or her infant. So In this article i will summarize and translate Shaykh Ghulam Mustafa Zaheer's short risalah on the aforementioned subject.
It was narrated from Anas bin Malik that:
he came to Prophet in Al-Madinah when he was eating breakfast. The Prophet said to him: "Come and eat the breakfast." He said: "I am fasting." The Prophet said to him: "Allah, the mighty and sublime, has waived fasting and half of the prayer for the traveler and for pregnant and breastfeeding women."
[Ref: Sunan an-Nasa'i 2315; Imam an-Nasa'e has put this hadeeth under the chapter titling it as "Chapter: Fasting is waived for pregnant and breastfeeding women" and Imam Abu `Esa Tirmidhi graded this narration as good and Imam ibn Khuzayma has classed this as authentic in his book Saheeh (2044)]
One of the senior companions of Prophet Muhammad , Ibn `Umar (may allah be pleased with him) was asked regarding a pregnant woman who fears for her unborn child (due to her fasting/staying hungry for a long while). Ibn `Umar said
"Ask her to abandon fasting and instead feed a poor person one mudd` (approx. half kilogram) of wheat (for per fast which she misses)
[Ref: Sunan al-Kubra of Imam Bayhaqi 4/230 with an authentic chain. Also note how Islamic law stipulates that the compensation be in terms of aiding and benefiting the poor and needy instead of some other religions that either enforced its followers to offer a sacrifice or some meat to their Lords or to give that money to the head of the temple and etc.]
Another woman asked Ibn `Umar regarding her fasting to which he replied
أفطری، أطعمی عن کل یوم مسکیناً ولا تقضی.”
"Leave fasting and feed one poor person per day instead (as the messenger of allah commanded) and you do not have to make up your missed fasts later on"
[Ref: Sunan Daraqutni (1/207; H: 2363) with an authentic chain]
Nafi reports that one of Ibn `Umar's daughter was wedded to a Quraishi male and was pregnant. (During ramadan while fasting) she experienced thirst so Ibn `Umar commanded her to break her fast (for her and her child's need and safety) and instead feed a poor person "
[Ref: Sunan Ad-Daraqutni (1/207; H: 2364) with an authentic chain]
Ibn `Abbas explaining the verse
وَعَلَى الَّذِينَ يُطِيقُونَهُ فِدْيَةٌ طَعَامُ مِسْكِينٍ
And upon those who are able [to fast, but with hardship] - a ransom [as substitute] of feeding a poor person [each day]. [2:184]
said :
اثبتت للحبلی والمرضع
(The ruling of this verse) is established for pregnant and breast feeding women
[Ref: Sunan abi Dawood , 3217]
The successor (i.e. those who studied from the companions of the prophet) Sa`eed ibn Jubayr says regarding a pregnant or breastfeeding woman who fears for her child or her health (that will also affect her child) due to fasting ; that such a woman is to avoid fasting and instead feed a poor per fast and they don't even have to make up for their fasts later on
[Ref: Musannaf `Abdur-razzaq 4/216 H: 7555; with an authentic chain]
Conclusion (As per shaykh Ghulam Mustafa and those scholars who agree with him) : A pregnant woman or a breast feeding woman who fears for her health and her child's health or needs is exempted from fasting and she has to feed a poor person (approx half a kilo minimum of staple food like wheat etc) for every fast she skips and doesn't have to make it up later on either.
Please note: This is one opinion and there is another opinion too that stipulates she has to make up for the fasts. Please see this link: https://islamqa.info/en/50005 and https://islamqa.info/en/49794