Women may go to the mosques and pray in congregation
➊ It is narrated from Abu Hurayrah (may Allah be pleased with him) that the Prophet ﷺ said:
لا تمنعوا إماء الله مساجد الله
“Do not prevent the female servants of Allah (that is, women) from the mosques.”
➋ It is narrated from Ibn Umar (may Allah be pleased with them both) that the Prophet ﷺ said:
إذا استأذنكم نسالكم بالليل إلى المساجد فاذنوا لهن
“If your women ask your permission to go to the mosques at night, then give them permission.”
(Nawawi, may Allah have mercy on him) The prohibition in the first hadith is not for prohibition (tahrim) but for dislike (karahah). It is also learned from these hadiths that women should seek permission from their husbands (to go out, whether to the mosques or to other places).