Generally speaking, women are allowed to go out in order to offer Prayer in the Mosque and to attend Prayer as stated by the following Hadiths. Ibn ‘Umar (may Allah be pleased with him) narrated, “I heard the Messenger of Allah (peace and blessings of Allah be upon him) saying: “When your women ask you for permission to go to the mosque, give them permission.” According to another version, “Do not forbid women their share of the mosques if they ask you for permission.” (Related by Muslim) Also, Umm `Atiyyah (may Allah be pleased with her) reported, “The Prophet (peace and blessings of Allah be upon him) commanded us to bring out on the two `Eids (festival days) the adolescent girls and the virgins in seclusion, but he commanded the menstruating women to stay away from the prayer-place of the Muslims.” (Narrated by Al-Bukhari and Muslim) These Hadiths indicate that women are basically allowed to go out to perform Prayer in mosques.
However, scholars put some conditions for women going out to offer Prayer in mosques or for `Eid Prayer including, (a) Wearing complete Hijab in order not to tempt others. (b) Not wearing perfumes (c) There should be no danger on them when going out by kidnapping, rape, and the like.
In addressing this issue, Dr. Rajab Abu Mleeh stated,
“In fact, women are permitted to attend Prayer in mosques and in `Eid Musallah. The Hadiths of the Prophet in this regard stated the permissibility of this. If the cause behind prevention of women to attend Prayer in mosques or in `Eid Musallah is only regarding women as a fitnah (temptation) in themselves, even if the woman observes the religious etiquettes as regards their clothes, mingling with men, adornment, speaking to men, etc., then that is not a valid cause in itself for suspending this legal ruling. The Prophet (peace be upon him) allowed women to go out to mosques.
If the cause for this is the uncontrollable mingling with men or not adhering to Islamic ethics of dress, then scholars in your country will be right in preventing women due to this. However, if there are other causes for that such as actual fear of rape or abduction, it is allowable to temporarily prevent woman until the concerned authorities deal with that matter, and after that women can go out.
All in all, women should be decent and wear Hijab and men should observe Islamic ethics regarding dealing with women. When offering the Prayer, women should be behind men, in a suitable place attached to the Mosque, or even in the upper floors as in many mosques.
It is also allowed for women to give amongst themselves pre-Jum’ah talk or a pre-`Eid talk on a condition that those women who deliver these talks are properly acquainted with the Islamic perspective concerning the subject they are dealing with in these talks.”