<s>[INST] $x^2$ is congruent to $-1 \bmod p$ In general, how do you solve $x^2$ is congruent to $-1 \bmod p$, where $p$ is an odd prime and $x$ is an integer.
Specifically, I need to solve $x^2\equiv-1 \pmod{29}$
 [/INST] Since you can figure out
$$ 29 = 25 + 4 = 5^2 + 2^2 $$
in your head, you see
$$ 5^2 + 2^2 \equiv 0 \pmod {29}, $$
$$ 5^2 \equiv - 2^2 \pmod {29}. $$
Bothe 2 and 5 are relatively prime to $29,$ either one has a multiplicative inverse mod 29.
$$ \frac{5^2}{2^2} \equiv -1 \pmod {29},  $$
$$ \left( \frac{5}{2} \right)^2 \equiv -1 \pmod {29}.  $$
So, you need to figure out the multiplicative inverse of $2 \pmod {29}$ and multiply that by $5.$ whatever that becomes $\pmod {29}$ is what you need.
Not a coincidence: the other square root is
$$ - \frac{5}{2} \equiv \frac{2}{5} \pmod{29}.  $$
</s>