A doubt in Hatcher's Algebraic Topology. I refer to pg. 27 of Hatcher's Algebraic Topology. 
I refer to the part where Hatcher proves that $f.(g.h)\cong (f.g).h$
For the life of me, I cannot figure out how the diagram on the right proves this. What does the diagram even mean?
 A: Remember that $f\cdot(g\cdot h)$ is the function from $[0,1]$ to $X$ such that $$[f\cdot(g\cdot h)](t) = \begin{cases} f(2t) &t\in[0,\frac1{2}]\\
g(4t-2) & t\in[\frac1{2}, \frac{3}{4}]\\
h(4t-3) & t\in[\frac3{4}, 1]\end{cases}$$
while $(f\cdot g)\cdot h$ is the function from $[0,1]$ to $X$ such that
$$[(f\cdot g)\cdot h](t) = \begin{cases} f(4t) &t\in[0,\frac1{4}]\\
g(4t-1) & t\in[\frac1{4}, \frac{1}{2}]\\
h(2t-1) & t\in[\frac1{2}, 1]\end{cases}.$$
Let us denote those two functions by $p_0$ and $p_1$, respectively.
So we want to find a homotopy between $p_0$ and $p_1$. Note that if $f$ is a path, and $\gamma\colon [0,1]\rightarrow [0,1]$ is an increasing homeomorphism, then $f$ and $f\circ\gamma$ are homotopic: the homotopy is $\varphi:[0,1]\times [0,1]\rightarrow X$ such that $\varphi(s,t) = f(t\gamma(s) + (1-t)s)$. Indeed:


*

*we have $\varphi(s,0) = f(s)$ for all $s\in[0,1]$,

*$\varphi(s,1) = f(\gamma(s))$ for all $s\in[0,1]$,

*$\varphi(0,t) = f(t\gamma(0) + (1-t)\gamma(0)) = f(\gamma(0)) = f(0)$, and

*$\varphi(1,t) = f(t\gamma(1) + (1-t)\gamma(1)) = f(\gamma(1)) = f(1)$.


Now it remains to note that there exists $\gamma\colon[0,1]\rightarrow [0,1]$ such that $p_0 = p_1\circ \gamma$. So let $\gamma$ be defined by:
$$\gamma(t) = \begin{cases}\frac{t}{2} & t\in[0,\frac1{2}] \\
t-\frac1{4} & t\in[\frac1{2}, \frac3{4}]\\
2t-1 & t\in[\frac3{4}, 1]\end{cases}.$$
Let us check that it indeed does the job:
For $t\leq \frac1{2}$, $p_1(\gamma(t)) = p_1(\frac{t}{2}) = f(4\frac{t}{2}) = f(2t) = p_0(t)$, for $\frac1{2}\leq t\leq \frac{3}{4}$, $p_1(\gamma(t)) = p_1(t-\frac{1}{4}) = g(4(t-\frac{1}{4})-1) = g(4t-2) = p_0(t)$ and finally, for $t\geq \frac{3}{4}$, we have $p_1(\gamma(t)) = p_1(2t-1) = h(4t-2-1) = h(4t-3) = p_0(t)$.
Finally, note that the graph of the function $\gamma$ above is precisely the graph drawn in Hatcher's book.
A: In general, if $f$ is a path and $\phi : I \to I$ is a continuous map such that $\phi(0)=0$ and $\phi(1)=1$, then $f \circ \phi$ is homotopic to $f$. This is explained by Hatcher.
Now consider three paths $f,g,h$ with $f(1)=g(0)$, $g(1)=h(0)$, so that the paths $(fg)h$ and $f(gh)$ are well-defined.
Consider the map $\phi : I \to I$ defined by
$\phi(t) = \left\{\begin{array}{c} t/2 & 0 \leq t \leq 1/2 \\ t - 1/4 & 1/2 \leq t \leq 3/4 \\ 2t-1 & 3/4 \leq t \leq 1\end{array} \right..$
Now compute $f(gh) = (fg)h \circ \phi$. Hence, $f(gh)$ is homotopic to $(fg)h$.
You can find a different (but also graphical) proof in May's Concise course (p.6).
