[step:Verify based-homotopy invariance $f \simeq f' \implies \pi_1(f) = \pi_1(f')$]Suppose $f \simeq f'$ as based maps, i.e., there exists a continuous map $H: X \times I \to Y$ with
\begin{align*}
H(x, 0) = f(x), \quad H(x, 1) = f'(x) \text{ for all } x \in X, \quad H(x_0, t) = y_0 \text{ for all } t \in I.
\end{align*}
Let $\gamma$ be a loop at $x_0$. Define
\begin{align*}
K: I \times I &\to Y \\
(s, t) &\mapsto H(\gamma(s), t).
\end{align*}
$K$ is the composition of the continuous map $(s, t) \mapsto (\gamma(s), t)$ with the continuous $H$, hence continuous. Its boundary values are
\begin{align*}
K(s, 0) = H(\gamma(s), 0) = f(\gamma(s)) = (f \circ \gamma)(s), \\
K(s, 1) = H(\gamma(s), 1) = f'(\gamma(s)) = (f' \circ \gamma)(s).
\end{align*}
At the endpoints of $I$ in the $s$-direction, using $\gamma(0) = \gamma(1) = x_0$ and the hypothesis $H(x_0, t) = y_0$,
\begin{align*}
K(0, t) = H(\gamma(0), t) = H(x_0, t) = y_0, \quad K(1, t) = H(\gamma(1), t) = H(x_0, t) = y_0 \text{ for all } t \in I.
\end{align*}
Thus $K$ is a path homotopy from $f \circ \gamma$ to $f' \circ \gamma$ rel $\{0, 1\}$, so $[f \circ \gamma] = [f' \circ \gamma]$ in $\pi_1(Y, y_0)$. That is, $\pi_1(f)([\gamma]) = \pi_1(f')([\gamma])$ for every class, and therefore $\pi_1(f) = \pi_1(f')$.[/step]