[step:Prove that the induced map is well-defined on based homotopy classes]
Define a set map
\begin{align*}
f_*:\pi_1(X,x_0)&\to\pi_1(Y,y_0)\\
[\gamma]&\mapsto [f\circ\gamma].
\end{align*}
We prove that this definition is independent of the representative $\gamma$.
Suppose $\gamma_0:I\to X$ and $\gamma_1:I\to X$ are based loops at $x_0$ with $[\gamma_0]=[\gamma_1]$ in $\pi_1(X,x_0)$. By definition, there exists a based homotopy
\begin{align*}
H:I\times I&\to X
\end{align*}
such that
\begin{align*}
H(s,0)&=\gamma_0(s),&
H(s,1)&=\gamma_1(s),&
H(0,t)&=x_0,&
H(1,t)&=x_0
\end{align*}
for all $s,t\in I$.
Define
\begin{align*}
K:I\times I&\to Y\\
(s,t)&\mapsto f(H(s,t)).
\end{align*}
The map $K$ is continuous because $K=f\circ H$. For all $s,t\in I$,
\begin{align*}
K(s,0)&=f(H(s,0))=f(\gamma_0(s))=(f\circ\gamma_0)(s),\\
K(s,1)&=f(H(s,1))=f(\gamma_1(s))=(f\circ\gamma_1)(s),\\
K(0,t)&=f(H(0,t))=f(x_0)=y_0,\\
K(1,t)&=f(H(1,t))=f(x_0)=y_0.
\end{align*}
Hence $K$ is a based homotopy from $f\circ\gamma_0$ to $f\circ\gamma_1$. Therefore
\begin{align*}
[f\circ\gamma_0]=[f\circ\gamma_1]
\end{align*}
in $\pi_1(Y,y_0)$, so $f_*$ is well-defined.
[/step]