Here, Dr. Muzammil Siddiqi, former president of the Islamic Society of North America (ISNA), states:
Salat-ul-Janazah (funeral prayer) is a Fard Kifayah ( collective obligation) on men. This means that it’s a duty for the Muslim community to perform that prayer. If a Muslim dies in a community and some Muslims offer the funeral prayer for the deceased, then the duty will be deemed as being discharged on behalf of every one. However, failing to offer such a prayer incurs sin on the whole community, due to negligence. It is permissible for women to pray Salat-ul-Janazah with other Muslims in Jama`ah (congregation), but it is not obligatory upon them. This indicates that women do not have to leave their homes to attend the funeral prayer; however if they are available or wish to go to the funeral prayer, they are allowed to do so.”
In his book Fiqh-us-Sunnah, the late Azharite scholar Sheikh Sayyed Sabiq (may Allah bless his soul), adds:
“A woman, like a man, may offer a funeral prayer, singly or in a congregation. In fact, once when Umm `Abdullah offered funeral prayer for `Utbah, `Umar waited until she finished. `Aa’ishah ordered the body of Sa`d Ibn Abi Waqqas to be brought to her so that she could offer a funeral prayer over him.
An-Nawawi concludes: “Women may offer Salat-ul-Janazah in congregation just as they are permitted to perform other Sunnah prayers. Al-Hasan Ibn Saleh, Sufiyan Al-Thawri, Ahmad, and the Hanafi School also hold the same view. Malik, however, is of the opinion that women should offer Salat-ul-Janazah individually.”
Having clarified the above, we can add that if you mean by the phrase “going for funeral” joining or accompanying the funeral procession and carrying the dead to the grave, we would like to cite for you the fatwa given by Sheikh `Attiyyah Saqr, former head of Al-Azhar Fatwa Committee, in which he states the following:
“The Hadith reported as regards women following funeral procession is recorded by Al-Bukhari and Muslim on the authority of Umm `Atiyyah, who narrates: “We have been forbidden to accompany funeral processions but not strictly.” This implies, as Ibn Hajar states in Fath Al-Bari, that she meant they were not recommended to accompany funeral processions, but not forbidden to do so.
So, the warning in the Hadith is meant for Karaha Tanzihiyyah (proper disapproval) This is the view of the majority of scholars; however Imam Malik holds that it is permissible, and this is the opinion of the People of Madina, as Al-Qurtbi states. What supports the permissibility is the Hadith of Ibn Abi Shayba, who reports that the Prophet (peace and blessings be upon him) was attending a funeral and `Umar saw a woman (following the funeral procession). He yelled at her, but the Prophet (peace and blessings be upon him) said to him: “Leave her, `Umar! Verily her eyes shed tears, the soul feels the pangs, and the promised hour is near.”
All Hadiths which forbid women to accompany funeral procession are weak. What is prohibited is doing something haram while accompanying the funera
l procession, according to the Hadiths: “He who (on befalling a calamity) slaps his cheeks, tears his clothes and follows the ways and traditions of the Jahiliyyah (pre-Islamic period) is none of us.”