If $\displaystyle x$ is solution then $\displaystyle x\equiv r^y$ where $\displaystyle r$ is primitive root. Then it means $\displaystyle r^{2y}\equiv 1 (\bmod m)$. Therefore, $\displaystyle 2y \equiv 0 (\bmod \phi (m))$.
This congruence just has two solutions $\displaystyle y=0, \tfrac{\phi(m)}{2}$.
These two correspond to $\displaystyle x=\pm 1$.