What should a praying person who doubts having offered one, or two prostrations in the third Rakah (unit of prayer) do?
Whoever has doubts about their prayer should consider what is less i.e. the above person should offer another Sajda (prostration) and complete his/her prayer, then offer Sujood As-Sahw (prostration of forgetfulness). And Allah Knows Best.
Is it permissible for the man to go out wearing shorts?
All Perfect Praise is due to Allah, The Lord of The Worlds
It is permissible so long as his Awrah (private part), which is between his navel and knee, is covered. However, the regular wear traditions and modesty are to be observed. 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.
A man cursed Allah, is he allowed to perform prayer without making Ghusl?
All perfect praise be to Allah the Lord of the Worlds. May Allah`s peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
Cursing Allah is an act of apostasy and one who commits it must utter the testimonies of faith, make repentance, take back wife; however, it isn`t conditioned that he makes Ghusl (Full body ritual purification) to pray. And Allah The Almighty Knows Best.