Firstly: Performing a Fard Hajj on Behalf of one Able to Perform It
It is not permissible for one able to perform Hajj to appoint someone else to perform the fard Hajj on one’s behalf. Consensus on this was related by Ibn al-Mundhir, Ibn Qudamah, and Ibn Hajar.
Secondly: Performing a Fard Hajj on Behalf of one Unable to Perform It
It is wajib for one who is prevented by age or an illness that one does not expect to recover from to assign someone else to perform Hajj on one’s behalf if one has wealth.  A condition here is that the excuse – such as old age or a permanent illness – persist. Thus, this does not apply to someone who is ill but hopes to get well. It also does not include someone who is insane, as their sanity is hoped for; nor a prisoner, for their release is hoped for; nor a poor person, for it is possible to remove their poverty. This is the position of the Shafi`is, Hanbalis, one narration from Abu Hanifah, the position of his two companions, and the position of a group of the Salaf. This is the chosen position of al-Kamal al-Humam, Ibn Hazm, Ibn Baz, and Ibn `Uthaymin.
Thirdly: Assigning a Proxy and then Regaining Health
Scholars have differed regarding a person who sends someone else to perform Hajj on their behalf and then gets better before dying. They are two positions:
The first position: The Hajj of a person who sends someone else to perform it on their behalf and then gets better before dying suffices them. They are absolved of its fard performance. This is the position of the Hanbali and Zahiri schools, as well as the position of Ishaq ibn Rahawayh.
The second position: The Hajj of a person who sends someone else to perform it on their behalf and then gets better before dying does not absolve them of a fard Hajj. Such a person must perform Hajj on their own behalf. This is the position of the Hanafi and Shafi`i (according to the soundest position) schools. This is the chosen position of Ibn al-Mundhir.