Solution (source code)

= Solution

Take a generator $u$ of the <multiplicative group of a finite field> $\mathbb F_p^\times$, which has order $p-1$. Write $x=u^a$. Since any possible nonzero base is $y=u^r$, the condition of being a $k$th power is
$$
x=y^k\iff u^a=u^{kr}\iff kr\equiv a\pmod {p-1}.
$$
By part (a), this <linear congruence> is soluble exactly when $d=\gcd(k,p-1)$ divides $a$. Meanwhile
$$
x^{(p-1)/d}=1\iff u^{a(p-1)/d}=1\iff (p-1)\mid a(p-1)/d\iff d\mid a.
$$
Thus the required test is
$$
\boxed{x\text{ is a }k\text{th power in }\mathbb F_p^\times\iff x^{(p-1)/d}\equiv1\pmod p.}
$$
The exponent <residue classes> divisible by $d$ are $0,d,\ldots,p-1-d$, so there are exactly $(p-1)/d$ distinct nonzero $k$th powers. Equivalently, part (a) shows each value has exactly $d$ preimages under the power map.