In $ \mathbb{Z}_p $ where $ p $ is prime, what is the number of roots of $ x^2+1\equiv 0 \mod p $? 
In $ \mathbb{Z}_p $ where $ p $ is prime, what is the number of roots of $ x^2+1\equiv 0 \mod p $?

Since $ x^2\equiv -1 \mod p $, then $ x^4\equiv 1 \mod p $ and we have $ 4 | \phi(p) $. If $ p=5 $, then $ 2,3 $ are two roots of $ x^2+1\equiv 0 \mod 5 $, but what are the situations for other prime $ p $ like $ p=13 $? we can't check that all by hand right? Or does it just depend without a generous law?

Explicitly, when $p \equiv 1 \bmod 4$, the solutions of $x^2 \equiv 1 \bmod p$ are $\pm \left(\frac{p-1}{2}\right)!$. See here.
