Is wearing a cap permissible for boys, or girls?
All Perfect Praise is due to Allah, The Lord of The Worlds.
In principle, anything is permissible sol long as there is no Sharia evidence prohibiting it, thus wearing the cap by boys is permissible as long as it isn`t done in imitation of the disbelievers. Moreover, a Muslim woman should avoid all that which attracts the attention of men because whatever leads to the forbidden is forbidden. And Allah 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.
Is it permissible for the guardian to give Sadaqa (voluntary charity) from the money of the orphans?
It is impermissible for the guardian to donate from the money of the orphans because he is entrusted with the safekeeping of that money, and is prohibited from donating it.
Is it permissible for a Muslim physician to specialize in gynecology obstetrics, and what is the ruling on working as such?
Some fields of knowledge are an individual duty while others are a collective one, and specializing in gynecology obstetrics is a collective duty. However, if there were female physicians to treat women, then there is no need for a male gynecology obstetrics specialist to look at women`s Awrahs (private parts) except in necessary situations since the jurisprudential maxim says:” Necessity must only be assessed and answered proportionately.” And Allah Knows Best.