I have this problem assigned for homework and I'm confused as to how to solve an $x^2$ congruence. Here is the problem:
$x^2\equiv 1\pmod{140}$
My only thought was to do something along the lines of:
$x^2\equiv 1\pmod{140}\implies x^2 -1= (x+1)(x-1)\equiv 0\pmod{140}\dotsc$
or to solve the system:
$x^2\equiv 1\pmod{2}, x^2\equiv 1\pmod{5}, x^2\equiv 1\pmod{7}$ since $140=2^2 \cdot 5 \cdot 7$.
And could I use the same techniques for solving this to also solve $x^2\equiv x\pmod{180}$?
Thanks in advance!