Proof (homotopy induces basepoint change on fundamental groups)

Take a loop $γ: [0,1]\to X$ based at $x_0$. We want to show $$ \begin{align*} g\circ γ \simeq u\inv \cdot (f\circ γ) \cdot u. \end{align*} $$

Consider $$ \begin{align*} F : [0,1]\times [0,1] &\to Y \\ (s,t) &\mapsto H(γ(s), t). \end{align*} $$

Define two paths on $[0,1]^2$ from $(0,1)$ to $(1,1)$: $l^+$ given by $s \mapsto (s,1)$, and $l^-$ given by concatenating the paths $s \mapsto (0, 1-s)$, $s \mapsto (s,0)$ and $s \mapsto (1,s)$.

They are homotopic as paths via $H'(s,t) = t \, l^-(s) + (1-t) \, l^+(s)$ using the vector space structure on $\R^2 \supset [0,1]^2$ and the fact that $[0,1]^2$ is convex.

Finally note $$ \begin{align*} g\circ γ = F\circ l^+ \simeq F\circ l^- = u\inv\cdot (f\circ γ) \cdot u \end{align*} $$ as paths from $g(x_0)$ to $g(x_0)$.