If $x^2\equiv 1(\bmod m)$ then write $x\equiv r^y$ where $r$ is a primitive root.
Therefore, $r^{2y}\equiv r^0 (\bmod m)\implies 2y\equiv 0(\bmod \phi(m) )$.