In the school where I teach, the principal asked the teachers to pray in congregation with the students in the school's premises instead of going to the nearby mosque so that the teachers would be able to guard the students. If there are already enough teachers to guard the students, do I have to go and pray in the nearby mosque or can I pray in the school's premises?
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 is His slave and Messenger.
The view that we adopt here in Islamweb is that the prayer in the mosque is not obligatory and that establishing a congregation at any place fulfills the obligation.
Therefore, you are not obliged to go to the mosque. We advise you not to violate the law of the school and its system so as not to be a reason for others to evade the system, and so that you do not subject yourself to questioning, and possibly to harm.
You can pray with your brothers at school and you are not sinful for this, Allah willing.
For more benefit, please refer to Fatwa 91186.
Allah Knows best.
You can search for fatwa through many choices