If $p\equiv 1\pmod{8}$, then $-1$ is fourth power? I know that $-1$ is a square modulo $p$ iff $p\equiv 1\pmod{4}$. Curious about this, I'm trying to show that $-1$ is a fourth power if and only if $p\equiv 1\pmod{8}$, for $p$ odd.
I know that if $a^4\equiv -1\pmod{p}$ for some $a$, then
$$
(-1)^{(p-1)/4}\equiv (a^4)^{(p-1)/4}\equiv a^{p-1}\equiv 1\pmod{p}.
$$
So since $p$ is odd, $(-1)^{(p-1)/4}=1$, so $(p-1)/4$ is even, and thus $p\equiv 1\pmod{8}$.
How can the converse be shown? I was trying to break $(p-1)!$ into a power of $4$, by grouping the factors together without success. Thanks.
 A: This is a direct consequence of the following more general result.
Theorem: Let $m$ be a positive integer that has a primitive root, and suppose that $\gcd(a,m)=1$. Then the congruence $x^k\equiv a\pmod{m}$ has a solution if and only if 
$$a^{\varphi(m)/\gcd(\varphi(m),k)}\equiv 1\pmod {m}.\tag{$1$}$$ 
To prove the result, let $g$ be a primitive root of $m$, and let $d=\gcd(\varphi(m),k)$. Taking indices with respect to $g$, we see that the congruence $x^k\equiv a\pmod{p}$ holds iff 
$$k\,\text{ind}\, x\equiv \text{ind}\,a \pmod{\varphi(m)}.\tag{$2$}$$ 
The linear congruence $(2)$ has a solution for $\text{ind}\,x$ iff $d$ divides $\text{ind}\, a$.
To complete the proof, we show that $(1)$ holds iff $d$ divides $\text{ind}\,a$. 
By taking indices, we can see that $(1)$ is equivalent to $\frac{\varphi(m)}{d}\text{ind}\, a\equiv 0\pmod {\varphi(m)}$. This holds iff $d$ divides $\text{ind}\,a$.
A: You can also use the fact that the multiplicative group of a finite field is cyclic (not difficult to prove directly, but proofs can be found in many textbooks, for example "Topics in Algebra" by Herstein). Let $a$ be an element of (multiplicative) order $p-1$ in the field $\mathbb{Z}/p\mathbb{Z}$. Then if $p \equiv 1 $ (mod 8), we see that $b = a^{\frac{p-1}{8}}$ is an element of (multiplicative) order $8$ in $\mathbb{Z}/p\mathbb{Z}$. Then $c = b^{4}$ satisfies $c^{2} = 1 \neq c,$ and so $c = -1,$ which has also been expressed as the fourth power of $b.$
