Having a mahram is a condition for Hajj to be obligatory upon a woman
As Shaykh Wahbah al-Zuhayli (may Allah have mercy on him) has reported this.
[Al-Fiqh al-Islami wa Adillatuhu: 2092/3]
➊ It is narrated from Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah ﷺ said:
لا تسافر المرأة ثلثة أيام إلا مع ذي محرم
“A woman must not travel for three days without a mahram relative.”
[Sahih al-Bukhari: 1086, Kitab Taqsir al-Salah: Bab Fi Kam Yaqsur al-Salah, Sahih Muslim: 1338, Sunan Abi Dawud: 1727]
➋ It is narrated from Abu Hurayrah (may Allah be pleased with him) that the Prophet ﷺ said: “It is not lawful for any woman who believes in Allah the Exalted and the Last Day
أن تسافر مسيرة يوم وليلة ليس معها حرمة
“to travel a day and a night without a mahram relative.”
[Sahih al-Bukhari: 1088 also, Sahih Muslim: 1339, Sunan Abi Dawud: 1724, Jami’ al-Tirmidhi: 1170]
➌ A man said: “My wife has set out for Hajj, and my name has been written down for such and such a expedition.” So the Prophet ﷺ said:
انطلق فحج مع امرأتك
“Go and perform Hajj with your wife.”
[Sahih Muslim: 1341, Kitab al-Hajj: Bab Safar al-Mar’ah ma’a Mahram ila Hajj wa Ghayrihi]