A woman had a miscarriage in the third month of her pregnancy during Ramadan, so she broke her Sawm (Fast) for five days due to the presence of blood after the miscarriage. Although she continued to have blood in her vagina, she then continued with her Sawm and Salah (Prayer)
for twenty-five days. Were her Salah and Sawm valid? It should be noted that in this situation, she performed Wudu' (ablution) for every Salah and she has remained in this situation up until now, finding blood and moisture in her vagina. She said that she used to use contraceptive pills that stopped her conceiving and having menstrual periods before she became pregnant.
All praise be to Allah Alone, and peace and blessings be upon His Messenger, and his family and Companions.
If the situation is as you mentioned, and the woman miscarried in the third month of pregnancy, the blood is not considered as postpartum blood, because what she lost in the miscarriage was an `Alaqah (clot; a piece of coagulated blood) and not a completed fetus. Consequently, her Sawm was valid and her Salah was too, even if she finds blood inside her vagina, as long as she performs Wudu' (ablution) before every Salah, as was mentioned in the question. She has to make up for the five days on which she missed the Sawm and Salah. This blood is considered to be Istihadah (abnormal vaginal bleeding outside the menstrual or post-partum period).May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.