My textbook says that in order to solve $x^2 \equiv a\bmod m$, it’s enough that we know how to solve it when $a$ and $m$ are coprime. Because in case that they are not, write $d = \gcd(a,m)$ and $a =da’$, $m=dm’$, solving $y^2 \equiv a’ \bmod m’$ we get that $x=yd$ is a solution to the original question.
But this is wrong no? With the simple example $x^2 \equiv 2 \bmod 14$, solving $y^2 \equiv 1 \bmod 7$ we get that $(\pm 1)\cdot 2$ is a solution to the original question, but that is not the case.
I think there is a mistake somewhere, maybe some $'$ that should be removed, but I can’t figure it out.