Path connected spaces with same homotopy type have isomorphic fundamental groups I was try to understand the following theorem:-

Let $X,Y$ be two path connected spaces which are of the same homotopy type.Then their fundamental groups are isomorphic.

Proof: The fundamental groups of both the spaces $X$ and $Y$ are independent on the base points since they are path connected. Since $X$ and $Y$ are of the same homotopy type, there exist continuous maps $f:X\to Y $ and $g:Y\to X$ such that $g\circ f\sim I_X$ by a homotopy, say, $F$ and $f\circ g \sim I_Y$ by some homotopy, say $G$. Let $x_0\in X$ be a base point. Let
$$f_\#:\pi_1(X,x_0)\to \pi_1(Y,f(x_0))$$ and $$g_\#:\pi_1(Y,f(x_0))\to \pi_1(X,g(f(x_0)))$$ be the induced homomorphisms. Let $\sigma$ be the path joining $x_0$ to $gf(x_0)$ defined by the homotopy $F$.

After that the author says that $\sigma_\#$ is a isomorphism. obviously $\sigma_\#$ is a homomorphism but I could not understand how it becomes a isomorphism.

Can someone explain me please. thanks for your kind help and time.
I suppose $σ$ is a path from $x_0$ the a point $x_1$ and the map $\sigma_\#$ is defined as:
$$σ_\#:\pi_1(X,x_0)\to π_0(X,x_1)\\σ_\#([p])=[σ\cdot p\cdot\barσ]$$ where $σ⋅p$ is the path which first traverses the loop $p$ and then $σ$, and $\bar σ$ is the reversed path.

This is a bijection because it has the inverse $\barσ_♯$ which we see by calculating $$\barσ_\#σ_\#([p])=[\barσ⋅σ⋅p⋅\barσ⋅σ]=[\barσ⋅σ]⋅[p]⋅[\barσ⋅σ]=[p]$$ as the homotopy class of $[\barσ⋅σ]$ is trivial.  Similarly, we get $σ_\#\barσ_\#([p])=[p]$
$f_{\#}:\pi_1(X,x_0) \to \pi_1(Y,f(x_0))$ is an isomorphism since $f$ is an homotopy equivalence; moreover $\pi_1(Y,f(x_0)) \simeq \pi_1(Y,y_0)$ since $Y$ is path-connected.