How often does $-1$ have a square root in a local field? Let $F$ be a nonarchimedean local field, say, charactersitic $0$. Is there any general theorem that tells when $\sqrt{-1}$ exists in $F$? How often does it happen?
 A: For a $p$—adic field $K$ (a finite extension of $\mathbf Q_p$), Hensel’s lemma for $f(x) = x^2+1$ with initial guess $x=a$ in $\mathcal O_K^\times$ says a sufficient condition for $f(x)$ to have a root near $a$ in $K$ is $|f(a)| < |f’(a)|^2$, which says $|a^2+1| < |4|$. That is equivalent to $a^2+1 \equiv 0 \bmod 4\pi$, where $\pi$ is a uniformizer in $K$.
Conversely, if $x^2+1$ has a root $r$ in $K$ then $r$ must lie in $\mathcal O_K$, and for all $a \equiv r \bmod 4\pi$ we have
$$
a^2+1 \equiv r^2+1=0 \bmod 4\pi.
$$
So a $p$-adic field $K$ contains a square root of $-1$ if and only if $\mathcal O_K/(4\pi)$ contains a square root of $-1$.
When $p\not= 2$, $4$ is a unit in $\mathcal O_K$, so in this case the congruence mod $4\pi$ is a congruence mod $\pi$, which means a necessary and sufficient condition is that the group $(\mathcal O/(\pi))^\times$ contain a square root of $-1$. This unit group of the residue field has size $q-1$, where $q$ is the size of the residue field, and that unit group is cyclic, so it has a square root of $-1$ (an element of order $4$) iff $4\mid (q-1)$, as Wojowu points out in a comment above.
