Hatcher chapter 0 exercise. Show that $f:X \rightarrow Y$ is a homotopy equivalence if there exist maps $g,h:Y \rightarrow X$ such that $fg \simeq \mathbb{1}$ and $hf \simeq \mathbb{1}$.
Why isn't this trivial. Surely if f is a homotopy equivalence we get the maps for free with say g=h. 
 A: If you are familiar with categories then this can help:
$f:X\rightarrow Y$ is a homotopy equivalence in category $\mathbf{Top}$
is exactly the same statement as: $\left[f\right]:X\rightarrow Y$
is an isomorphism in category $\mathbf{hTop}$.
$g,h\in\mathbf{Top}\left(Y,X\right)$ with $fg\simeq1$ and $hf\simeq1$
is exactly the same statement as: $\left[g\right],\left[h\right]\in\mathbf{hTop}\left(Y,X\right)$
with $\left[f\right]\left[g\right]=1$ and $\left[h\right]\left[f\right]=1$.
Based on the last result we find: $\left[g\right]=\left[1\right]\left[g\right]=\left(\left[h\right]\left[f\right]\right)\left[g\right]=\left[h\right]\left(\left[f\right]\left[g\right]\right)=\left[h\right]\left[1\right]=\left[h\right]$. 
Then we have $\left[f\right]\left[g\right]=1$ and $\left[g\right]\left[f\right]=\left[h\right]\left[f\right]=1$
or equivalently: $\left[f\right]$ is an isomorphism.
The last statement is exactly the same
statement as: $f$ is a homotopy equivalence.
A: This answer assumes the following theorem, so if it's not something you feel you can use you'll need to prove it first:
If $f_1,g_1\colon X\to Y$ are homotopic, and $f_2,g_2\colon Y\to Z$ are homotopic, then the compositions $f_2\circ f_1$ and $g_2\circ g_1$ are also homotopic.
Assuming this theorem, we show that if $fg\backsimeq1$ and $hf\backsimeq1$ then $g\backsimeq h$, so $1\backsimeq fg\backsimeq fh$ and $f$ is by definition a homotopy  equivalence (with inverse homotopy equivalence $h$). To do this, we use the above theorem and the associativity of composition to find:
$$h=h\circ 1\backsimeq h(fg)=(hf)g\backsimeq 1\circ g=g$$
So $g\backsimeq h$ and we have the result as above.
