[guided]The left and right concatenations assign different fractions of $I$ to $\gamma_0, \gamma_1, \gamma_2$. The left concatenation splits $I$ at the breakpoints $(1/4, 1/2)$; the right concatenation splits it at $(1/2, 3/4)$. The strategy is to construct a homotopy whose breakpoints **slide linearly** between these two pairs.
Let $a(t) = (1+t)/4$ interpolate between $1/4$ and $1/2$, and $b(t) = (2+t)/4$ interpolate between $1/2$ and $3/4$. Both are affine in $t$, so continuous. At each time $t$, we want the first segment $[0, a(t)]$ to traverse $\gamma_0$, the middle segment $[a(t), b(t)]$ to traverse $\gamma_1$, and the last segment $[b(t), 1]$ to traverse $\gamma_2$. To make each piece a path, we rescale each subinterval affinely onto $[0, 1]$ and compose with the relevant $\gamma_i$:
\begin{align*}
H: I \times I &\to X \\
(s, t) &\mapsto \begin{cases}
\gamma_0\!\left(\dfrac{s}{a(t)}\right) & 0 \le s \le a(t), \\[4pt]
\gamma_1\!\left(\dfrac{s - a(t)}{b(t) - a(t)}\right) & a(t) \le s \le b(t), \\[4pt]
\gamma_2\!\left(\dfrac{s - b(t)}{1 - b(t)}\right) & b(t) \le s \le 1.
\end{cases}
\end{align*}
**Checking continuity.** The three sets $A_1, A_2, A_3$ defined above are closed (they are preimages of $[0, \infty)$ under continuous functions like $a(t) - s$), and they cover $I \times I$. On each $A_i$, the formula is the composition of continuous operations: an affine function of $(s, t)$ fed into a continuous path. So each piece is continuous. The pasting lemma demands the pieces agree on overlaps, and that is exactly the matching condition $\gamma_0(1) = \gamma_1(0) = x_1$ and $\gamma_1(1) = \gamma_2(0) = x_2$ — these hold by hypothesis on the endpoints of the $\gamma_i$. So the pasting lemma gives global continuity.
**Checking endpoints.** At $t = 0$, substitute $(a(0), b(0)) = (1/4, 1/2)$ into $H(s, 0)$:
\begin{align*}
H(s, 0) = \begin{cases} \gamma_0(s / (1/4)) = \gamma_0(4s), & 0 \le s \le 1/4, \\ \gamma_1((s - 1/4)/(1/4)) = \gamma_1(4s - 1), & 1/4 \le s \le 1/2, \\ \gamma_2((s - 1/2)/(1/2)) = \gamma_2(2s - 1), & 1/2 \le s \le 1. \end{cases}
\end{align*}
This is the left concatenation $(\gamma_0 \cdot \gamma_1) \cdot \gamma_2$ on the nose. The $t = 1$ case is symmetric. And $H(0, t) = \gamma_0(0) = x_0$ and $H(1, t) = \gamma_2(1) = x_3$ for every $t$, so the homotopy is rel $\{0, 1\}$.
**Why this is the right picture.** Imagine $I \times I$ as a square with the time parameter $t$ going up. The lines $s = a(t)$ and $s = b(t)$ are two slanted line segments inside the square. They cut the square into three strips. Each strip is "time domain for one of the three paths", and the continuous rescaling on each strip converts the strip into a copy of $I$. Sliding the lines is what creates the homotopy.[/guided]