Solve $X^2\equiv-1\pmod{13}$ I've been asked to solve the following equation:
$$X^2 \equiv-1\pmod{13}.$$
I am not sure what to do.

You can try all possible solutions: $0,1,…,12$, though only half of them need to be tested.
For a more sophisticated solution, note that $13=4+9=2^2+3^2$ and so $3^2 \equiv -2^2 \bmod 13$. Since $2\cdot 7 \equiv 1 \bmod 13$, we conclude that $ -1 \equiv -2^2 \cdot 7^2 \equiv 3^2 \cdot 7^2 \equiv (3\cdot 7)^2 \equiv 8^2 \bmod 13$. The other solution is $13-8=5$.
This is a special case of a fact that plays a key role in Fermat's theorem on primes that are sums of two squares:

A prime $p$ is a sum of two squares iff there is a solution for $x^2\equiv -1 \bmod p$.

