(Hadith)
Another reason is that, many Muslims believe that God is omniscient (all-knowing). So if God is all-knowing, do Muslims really need to worship in the mosque? Wouldn’t God know that they are worshipping somewhere else?
“Do you not see that God knows everything in the heavens and on earth? Three men cannot talk together in secret, but He is the fourth…Neither fewer than that or more, but He is with them, wherever they may be.”
(Surah 58.7)
Some Muslims believe that as long as you have the correct intention (Niyyah) you can worship anywhere. Also, many women don’t go to the mosque (this is because, traditionally, women used to stay at home and look after the kids etc. while the men would attend the mosque). But they are still believed to be Muslims. If a woman is also menstruating, she is forbidden to go to the mosque. This is because Muslims believe that women are not entirely clean and pure while they are menstruating. Furthermore, some Muslims don’t go to the mosque because they might not be accepted in the community (ummah) due to, maybe, disputes between them. For example, a Muslim may have married a person outside their own religion, which is sometimes frowned upon in more traditional communities, resulting in disputes between the community and the Muslim. Finally, some Muslims agree with the statement because, praying in the mosque is not mentioned in the Qur’an, and was not mentioned when Muhammad (pbuh) was told to worship five times a day.
On the other hand, some Muslims disagree with this statement. They believe that it is compulsory (fard) for men to perform Jumaah prayers at the Khutbah (Friday sermon). As the Friday sermon takes place in a mosque, how can you be a Muslim without going to one? Furthermore, going on the pilgrimage to hajj is one of the 5 pillars of Islam (arkhan) and is compulsory. So, if you go on the hajj, you would visit the great mosque anyway. (Some Muslims may not go on the hajj because they may not be able to afford it, or they may not be physically well enough to travel). Another reason could be that most Muslims believe that Salah prayers should happen in a mosque. As Salah is one of Arkhan, it is fard. Also, many Muslims believe that they should follow the Sunnah (the example of Muhammad (pbuh)). As Muhammad (pbuh) went to the mosque, all Muslims should aswell. A final reason could be that Muslims should give Zakat ul Fit’r, which is also fard. Most Muslims give this at their local mosque.
In conclusion, I think that you can be a Muslim and not go to the mosque. This is because Muslims living in non-muslim countries may not get time off work to visit the mosque to pray. Also because some Muslims may wish to worship at home with their families, rather than praying in a mosque. And finally, as a mosque was never mentioned when Muhammad (pbuh) was told to worship five times a day, some Muslims may believe that there is no need to worship in a mosque.