Umm Atiyyah (May Allah be pleased with her) reported:
We (womenfolk) were prohibited from accompanying a funeral procession, but we were not compelled (not to do so).[Al-Bukhari and Muslim].
App reference: Book 7, Hadith 38
Arabic/English book reference: Book 7, Hadith 931