All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
Allaah ordained Hijab on the Muslim woman who reaches puberty. It is like all other obligations, not permissible to abandon except in case of dire necessity, as Allaah The Almighty Says (what means): {He has explained in detail to you what He has forbidden you, excepting that to which you are compelled.}[Quran 6:119] A necessity makes what is forbidden lawful. It is when a person reaches the point that if he does not do it, he will die, or nearly dies, or that he will face a hardship that is difficult for him to bear.
So, if wearing your Hijab causes a harm which you cannot repel except by removing it, then it becomes permissible to reveal only what repels off the harm, as necessity is valued according to its proper value.
In such a case, a woman is obliged to remain in her home and not go out except when she has to do so in order to fulfill her needs.
Studying is not a necessity that allows removing the Hijab when going out. The most that can be said about studying is that it is among the needs or the complimentary matters. So, if you can continue your studies at home or by being affiliated to an educational institution, then that settles this matter. Otherwise, it is not permissible for you to sacrifice an individual obligation – we mean the Hijab – in order to meet a need or a complimentary matter. For more benefit, please refer to Fataawa 84610 and 81554.
As regards the second part of your question, the answer is that you should consult a trustworthy Muslim doctor as he/she may give you permission to change the time of taking your medicine and instead of taking it by day, you will take it by night. By doing so, you combine between two benefits: the benefit of taking your medicine and the benefit of fasting.
However, if the medicine must be taken by day, and your disease permits you to break the fast, then you may do so as Allaah The Almighty Says (what means): {So whoever among you is ill or on a journey [during them] - then an equal number of days [are to be made up].}[Quran 2:184]
If this disease does not allow you to break the fast, and you have to take the medicine by day, and you will be harmed if you do not take it, then it becomes permissible for you to take it as a way of repelling harm.
Finally, it should be noted that the disease that permits a person to break the fast is the disease that makes it hard for a person to fast and harms him if he fasts. For more benefit, please refer to Fataawa 88381 and 85226.
Allaah Knows best.