I'm starting to learn abstract algebra and I'm following A book of abstract algebra of C.Pinter where in chapter four he proposes the systems of equations
\begin{align} x^2=b\\ x^5=e \end{align}
where $e$ is the identity and $x$ and $b$ are elements of a group. Now it shows that we can solve for $x$ i.e. theses conditions implie $x=(b^2)^{-1}$. But the first step is
$$x^2=b\implies x^4=b^2.$$
Now here is where I have the problem, this kind of steps are not necesarily revertible. For example if we were working on $\mathbb{Z}_4$ then we could have $$4\cdot 4=2\cdot 2$$ and it would be false that $4=2$.
And the thing when we solve equations is that we arrive at a solution that satisfies, i.e. makes true the conditions; but seeing this I can't see why that value of $x$ would satisfy the conditions.
I don't know if I'm terribly misunderstading a concept or if I'm overthinking the excercise. The real question is, is this reasoning right? Does it makes sense to solve equations in groups and other structures that doesn't behave very well in this sense? Any clarification is appreciated.