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 the marriage, which lacks a valid legal contract, a guardian, and a court registration, valid?
It is incumbent that a valid marriage contract be concluded in the presence of a guardian and two trustful witnesses, and it should be registered in the court to protect the rights of the wife. Actually, a valid marriage contract is what differentiates between sound marriage and fornication.
What is the ruling when a woman forsakes her husband in bed because he doesn`t pray regularly?
All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
He must pray regularly so as not to be admitted into Hell; however, you must obey him in lawful matters even if he doesn`t pray on regular basis because he is considered a disobedient Muslim and not an infidel. And Allah The Almighty Knows Best.