TITLE: Elements of $\mathbb{F}_p$ having cube roots in $\mathbb{F}_p$
QUESTION [6 upvotes]: Let $p$ be a prime number, and let $\mathbb{F}_p$ be the field with $p$ elements. How many elements of $\mathbb{F}_p$ have cube roots in $\mathbb{F}_p$?

I had this question on an exam and after reviewing I am still not sure. Any help would be appreciated.

REPLY [3 votes]: Consider the $3$-power map $f$ from the multiplicative subgroup $(\mathbb{Z}/p\mathbb{Z})^\times \longrightarrow (\mathbb{Z}/p\mathbb{Z})^\times$, given by $f(x) = x^3 \bmod p$. This is a homomorphism, so to find the size of the image it suffices to find the size of the kernel.
This group is cyclic, so there is some generator $g$ such that $(\mathbb{Z}/p\mathbb{Z})^\times = \langle g \rangle$. The kernel of the map $f$ in terms of $g$ consists of those elements $g^n$ such that $g^{3n} \equiv 1 \bmod p$. This occurs exactly when $3n$ is a multiple of $\varphi(p) = (p-1)$ (Fermat's Little Theorem and Carmichael's Theorem). Thus the kernel of the map $f$ consists of elements $g^n$ such that $3n \equiv 0 \bmod (p-1)$, or $3n = \alpha (p-1)$ for some integer $\alpha$. We may assume $1 \leq n \leq p-1$, as each element of $(\mathbb{Z}/p\mathbb{Z})^\times$ is given by one such $g^n$.
If $\gcd(3, p-1) = 1$, then necessarily $(p-1) \mid n$, which implies that $n = (p-1)$. In this case the only $g^n$ such that $g^{3n} \equiv 1 \bmod p$ is $g^{p-1} \equiv 1 \bmod p$. Thus the size of the kernel is $1$, and so the image has size $p-1$. All numbers mod $p$ are $3$th powers.
More generally, if $\gcd(3, p-1) = d$, then $f(g^{\frac{p-1}{d}}) = 1$, and this is also true of the $d$ powers of $g^{\frac{p-1}{d}}$ up to $g^{p-1}$. The size of the kernel is $d$, and thus the size of the image is $\frac{p-1}{d}$.
Here, this means if $\gcd(3, p-1) = 3$, then $f(g^{\frac{p-1}{3}}) = 1$, and it's precisely the three powers of $g^{\frac{p-1}{3}}$ in the kernel.
(This clearly generalizes to $k$-powers as well).