During his lifetime, the Prophet (peace and blessings be upon him) used to teach and instruct people in his Mosque. His Companions followed suit after he passed away.
Although there are no reports of women systematically teaching in the mosque, there are hundreds, even thousands, of prophetic traditions transmitted by women. Besides, hundreds of hadiths were reported by female Companions, especially the Prophet’s wives, which shows their scholarly rank as authorities in the Prophet’s Sunnah.
As a matter of fact, one of the features of scholarship following the Prophet’s time was that male scholars of hadith used to learn hadith reports from female Companions and Successors (tabi`iyat) who narrated the Sunnah form the Prophet (peace and blessings be upon him).
In her excellent book, Women Role in Serving Hadith During the First Three Decades, researcher Aamal Qurdash named a number of female hadith narrators who taught great male hadith scholars.
The list includes Fatimah, daughter of Imam Malik ibn Anas, Khadijah Umm Muhammad, Zainab bint Suliman al-Hashimiyah, Zainab bint Suliman ibn Abu Ja`far Al-Mansur, Um `Umar ath-Thaqafiyah, Asmaa’ bint Asad ibn Al-Furat, Sulaiha bint Abi Na`im Al-Fadl ibn Dukain, Samanah bint Hamdan al-Anbaiyah and `Abdah bint Abdulrahman ibn Mus`ab.
The author counted the numbers of female companions from whom great imams narrated haith as follows:
– Imam Al-Bukhari narrated hadith from 31 female Companions in his Al-Jami` As-Sahih
– Imam Muslim narrated from 36 female Companions in his Al-Jami` As-Sahih
– Abu Dawud, in his Sunan, narrated from 75 female Companions.
– At-Tirmidhi narrated from 46 female Companions in Sunan Al-Jami`.
– An-Nasa’i narrated from 65 female Companions in his Al-Mujtaba min as-Sunan.
– And ibn Majah, in his Sunan, narrated from 60 female Companions.
“It is only after the death of all wives of the Prophet (peace and blessings be upon him) that narrating hadith from women decreased. The wives of the prophet (may Allah be pleased with them) were frequently visited and referred to by female scholars.
However, transmitting hadith by women continued, yet less frequently, until all junior Companions, who lived long like Anas, `Abdullah ibn Abi Awfa and Ibn `Umar, passed away.” 
This decrease observed by the researcher is actually associated with the decline of Islamic civilization itself. Perhaps it is connected with the practice of barring women from going to the mosque in many places.
Yet, the information we have about female Muslim scholars during that golden era reveals the important role that can be played by Muslim women when they engage in the fields of knowledge and education.
In conclusion, there is no proof that women should not be permitted to teach men and women in the mosque. To the contrary, history shows that women’s activeness in scholarship marked a thriving Islamic civilization and flourishing scholarship in the fields of Shari`ah, the textual and rational alike.