Reading Allen Hatchers book (available online via this link) on Algebraic Topology, it states on page 3 that homotopy type defines an equivalence relation. The symmetry and reflexiveness are immediately seen, but the transitivity requires a little work. So my question is basically if this is the way to do it:
My attempt
Assume $X\simeq Y$ and $Y\simeq Z$. We must show that $X\simeq Z$. We have functions $$ \begin{align} X\overset{f_1}{\longrightarrow}&Y\overset{f_2}{\longrightarrow}Z\\ X\overset{g_1}{\longleftarrow}&Y\overset{g_2}{\longleftarrow}Z \end{align} $$ where $f_1g_1,g_1f_1,f_2g_2$ and $g_2f_2$ are homotopic to identities in the relevant spaces.
I claim that $f=f_2f_1$ and $g=g_1g_2$ are homotopy equivalence maps for $X\simeq Z$. To see this consider: $$ H(z,t)= \begin{cases} f_2\circ H_1(y,2t)\circ g_2,&\mbox{ for }t\in[0,0.5]\\ \quad\\ \quad\\ H_2(z,2t-1),&\mbox{ for }t\in[0.5,1] \end{cases} $$ where $H_1$ is a homotopy of $f_1g_1$ and $\mathbb{1}_Y$ whereas $H_2$ is a homotopy of $f_2g_2$ and $\mathbb{1}_Z$. Then $H(z,0)=fg$ and $H(z,1)=z$ so that $H$ is a homotopy of $fg$ and $\mathbb{1}_Z$. Of course one should check that $H$ depends continuously on $t$ especially for $t=0.5$ where $H(z,0.5)=f_2g_2$ by both definitions which will make that condition hold.
By very similar arguments it can be established that $gf\simeq\mathbb{1}_X$ and we are done.
Does this make sense and is it the way it is supposed to be carried out?
This is how it is supposed to be done, yes. You have to go from $0$ to $1$, and by going through the first mapping at twice the speed then going through the second mapping at twice the speed you get the proper speed for the whole composition of maps. (that way you spend half the total time on each)