Is a woman`s prayer considered invalid if non-Mahrams (marriageable men) saw her offering it?
A woman`s prayer isn`t invalidated if non-Mahrams saw her offering it, but she had better pray in isolation.
Is it permissible to trim the eyebrows if they become excessively long?
Trimming eyebrows is permissible if they become excessively long, yet; it is reprehensible. And Allah Knows Best.
My headcloth is causing me a terrible headache and severe shortsightedness. Is it permissible for me to take it off?
All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
If the headcloth Khimar is harmful, it is sufficient to wear the Niqab (face-veil). However, with the passage of time you will get used to the Khimar and these symptoms will go away. And Allah The Almighty Knows Best.
Is it permissible for one to masturbate in order not to commit fornication?
This is called committing the milder of the two evils such as eating a carcass in fear of death, and this happens when committing fornication is very likely to occur.