Praise be to Allah.
Is hijab compulsory?
The believing woman is enjoined to wear hijab . We have discussed hijab on this site in the answer to more than one question, and these answers tackle the matter from different angles. Some of them focus on the ruling on hijab and point out that it is obligatory, as in the answer to question no. 21536 . Some quote the definitive evidence for hijab being obligatory, such as the answers to questions no. 13998 and 11774 . Some describe the shar’i hijab, such as the answer to question no. 6991 . Other answers speak of the importance of hijab in the life of the believing woman.
Does not Wearing Hijab Break Your Fast?
If a woman does not wear hijab, then she is disobeying her Lord thereby, but her fast is still valid, because sins, including not wearing hijab, do not invalidate the fast, but they detract from its reward, and may cause it to be lost altogether.
What we urge you to do is wear hijab as well as fast, because the aim of fasting is not merely to give up food and drink, rather the aim is to fast or abstain from haram things. Hence the Prophet (peace and blessings of Allah be upon him) said: “Fasting is not just (abstention) from food and drink, rather fasting is (abstention) from idle and obscene talk.” (Narrated by al-Hakim and classed as sahih by al-Albani in Sahih al-Jami’, 5376)
Idle speech refers to that in which there is no benefit.
So let your fasting motivate you to obey Allah and keep away from that which He has forbidden.
We ask Allah to help you to do that which He loves and which pleases Him.
And Allah knows best.