Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear sister in Islam, thanks a lot for your question which reflects your care to have a clear view of the teachings of Islam. Allah commands Muslims to refer to people of knowledge to get themselves well-acquainted with the teachings of Islam as well as all aspects of life.
In his answer to the question, the late Sheikh Sayyed Ad-Darsh, former Chairman of the UK Shari`ah Council, stated the following:
"There are conflicting ahadith on this subject. While one set of ahadith prohibits such practices, another set seemingly goes the opposite way.
Those people who reject the idea altogether quote the following hadith in which the Prophet (peace and blessings be upon him) is reported to have said: Allah has cursed women who often go and visit graves. Another hadith relates an incident in which the Prophet (peace and blessings be upon him) asked his daughter, Fatimah, why she had left her house. She is reported to have replied: I went to the family of such-and-such a dead person and I prayed to Allah to shower His mercy on the person. The Prophet (peace and blessings be upon him) is then reported to have asked whether she went to the funeral and she replied: God forbid, how could I do such a thing when I have heard that you have forbidden this?'
However, those looking for evidence to show that women are allowed to visit graves quote some of the following ahadith: According to one tradition, the Prophet (peace and blessings be upon him) is reported after acknowledging that he had earlier forbade women to visit cemeteries to have said: Now you are allowed to go and visit them, for they remind you of the life to come. In another hadith, reported by Muslim and Al-Bukhari, the Prophet (peace and blessings be upon him) is reported by Umm `Atiyyah to have forbade women from following funeral prayers
but Umm `Atiyyah added, he did not stress it.
The question then is: what does the believer conclude form all this? After much deliberation, scholars have concluded that women can go to gave sides and cemeteries, providing they fulfill usual requirements in the same way as, for example, they go shopping or visiting friends and neighbors. This, say scholars, is the best method of combining the two sets of ahadith which may otherwise appear contradictory."