Let $ k $ be a positive integer. Let x be a positive integer that satisfies $ x \not\equiv 0 \pmod{8} $ and $ x \not\equiv 4 \pmod{8} $. Then is the following statement true?
$$ x^2 \equiv k^2 \pmod{16} \iff x \equiv \pm k \pmod{8}. $$
Example: Let $ x = 13 $. Then $ x^2 = 169 \equiv 9 \pmod{16} $ and $ x \equiv 5 \equiv -3 \pmod{8} $.
How can I prove it without enumerating all 16 possible cases for $ k $?