Wouldn't its affinity for oxygen decrease because the acidity of the body would increase with the lack of oxygen? The textbook said otherwise though and I don't understand.
The question seems to be based on the idea that there would be physiological adaptation to low oxygen, possibly through the Bohr effect. In fact the usual mechanism of adaptation is through genetic change.
There are a lot of examples of animals which live (or fly) at high altitude and which have a haemoglobin with a higher oxygen affinity. Examples which spring to mind are the bar-headed goose and the camelids of South America (llamas, alpacas etc.)
Haemoglobin has evolved as an efficient oxygen-delivery protein by having a variable affinity for oxygen: low affinity at low oxygen concentration, high affinity at high oxygen concentration. This is achieved through co-operative binding (allostery), and it ensures that the protein loads up with oxygen in the pulmonary circulation but releases oxygen in the peripheral tissues.
At high altitude, where the partial pressure of oxygen is lower, the haemoglobin of humans, for example, will not be fully saturated, impairing the delivery of oxygen to the body. Haemoglobin variants with an increase in the overall affinity for oxygen can achieve full loading at the expense of slightly less release in the tissues - overall a better oxygen delivery function. This is what happens in the camelids, but there is no such adaptation in humans living at high altitudes.