[step:Prove concatenation is well defined on homotopy classes]Suppose $[\alpha] = [\alpha']$ and $[\beta] = [\beta']$ in $\pi_1(X, x_0)$, witnessed by path homotopies $F, G: I \times I \to X$ with
\begin{align*}
F(s, 0) &= \alpha(s), & F(s, 1) &= \alpha'(s), & F(0, t) = F(1, t) &= x_0, \\
G(s, 0) &= \beta(s), & G(s, 1) &= \beta'(s), & G(0, t) = G(1, t) &= x_0.
\end{align*}
Define
\begin{align*}
H: I \times I &\to X \\
(s, t) &\mapsto \begin{cases} F(2s, t) & 0 \le s \le 1/2, \\ G(2s - 1, t) & 1/2 \le s \le 1. \end{cases}
\end{align*}
The closed sets $A = \{(s, t) : s \le 1/2\}$ and $B = \{(s, t) : s \ge 1/2\}$ cover $I \times I$. On each, $H$ is the composition of the continuous affine map $(s, t) \mapsto (2s, t)$ (respectively $(s, t) \mapsto (2s - 1, t)$) with the continuous map $F$ (respectively $G$). On the overlap $s = 1/2$, $F(1, t) = x_0 = G(0, t)$, so the two formulas agree. By the [pasting lemma](/pages/Pasting%20Lemma), $H$ is continuous.
Verify the boundary conditions: $H(s, 0) = F(2s, 0) = \alpha(2s)$ for $s \le 1/2$ and $G(2s - 1, 0) = \beta(2s - 1)$ for $s \ge 1/2$, hence $H(s, 0) = (\alpha \cdot \beta)(s)$. Similarly $H(s, 1) = (\alpha' \cdot \beta')(s)$. For the fixed-endpoints condition, $H(0, t) = F(0, t) = x_0$ and $H(1, t) = G(1, t) = x_0$ for every $t \in I$. So $H$ is a path homotopy from $\alpha \cdot \beta$ to $\alpha' \cdot \beta'$, giving $[\alpha \cdot \beta] = [\alpha' \cdot \beta']$. Thus $[\alpha] \cdot [\beta]$ is independent of representatives.[/step]