Considering the field $\mathbb Z_p$ in which $p$ is a prime; how many of roots satisfying $$x^2+1=0$$
I tried to look into $p=2,3,5,7$, but didn't find a rule for that. Is it that the number of roots depends on the value of $p$? Or there's a pattern that I didn't see. Thanks you.
Yes, the answer depends on $p$:
If $p \equiv 1 \mod 4$, then there are two distinct roots of $x^2 + 1$,
If $p \equiv 3 \mod 4$, then there are no roots,
If $p = 2$, then $1$ is a double root of $x^2 + 1$.
To see the first case, remember that the multiplicative group of $\mathbb{Z}/(p)$ is cyclic of order $p-1$. Let $g$ be a generator of the cyclic group; then $(p-1)/4$ is an integer and $g^{(p-1)/4}$ will be a primitive fourth root of $1$, i.e., a square root of $-1$. In the second case, where $4$ does not divide $p-1$, there can be no primitive fourth root (i.e., an element "$i$" of order $4$).