Should one go to masjid for prayer against his parents will?
Can I disobey my parents if they do not let me go to the masjid for prayer?
Only if the parents prevent from obeying the orders of Allah (swt), has one the right to disobey his parents
Since it’s not obligatory to perform prayers in the masjid, it is not an appropriate action to go to the mosque despite your parents’ disallowance.
However, if you go to the mosque to learn the Islamic knowledge which is fard al ayn (a personally obligatory religious duty) and if the mosque is the only place that you can get Islamic knowledge, then it is permissible to disobey your parents. Because, it is obligatory for every Muslim to learn enough Islam knowledge to perform his religious duties, distinguish between good and bad and between haram (prohibited) and halal.
Prophet Muhammad states:
“Seeking Knowledge is obligatory upon every Muslim.” (Ibn-I Maajah)
There is no obedience to anyone in disobedience to the obligatory orders of Allah (swt), but we should obey our parents with the nafila (supererogatory, optional) actions. However, whether we obey or disobey our parents, we should treat them with the best of the manners.
To learn more about this issue, you can read the article entitled
Does a Muslim Have the Right to Disobey His Parents if they Order Haram?