The Messenger of Allah ﷺ said, "Do not prevent your women from going to the mosques, though their homes are better for them."
قال رسول الله ﷺ: لا تمنعوا نساءكم ﷺ: المساجد، بيوتهن خير لهن.
Abu Dawud (567) narrated it from Uthman bin Abu Shayba, who said, Yazid bin Harun told us, Awwam bin Hawshab informed us, Habib bin Abu Thabit told me, from Ibn Umar, and he mentioned it. Its chain of transmission is sahih. Ibn Khuzayma (1684) also graded it sahih, as did Hakim (1/209), who said, "It is sahih according to the criteria of the two Shaykhs, for both of them relied on Awwam bin Hawshab, and Habib's hearing from Ibn Umar has been established as sound. They did not include it because of the addition, 'and their homes are better for them.'"