I'm trying to prove the following statement:
$x^n-1$ has $n$ roots in the finite field $\mathbb{F}_q$ if and only if $q = 1\pmod n$
For the forwards implication, I know that $x^n-1$ is separable but then I'm not sure where to go from here.
For the backwards implication, I used $q = 1\pmod n)$ to get that $n \mid q-1$, and then I've worked out the formal derivative $nx^{n-1}$ because I want to somehow show that they don't share a common factor, to then conclude that that $x^n-1$ is indeed separable. But I'm not sure how to reach that so I'm stuck on this bit too.
Any help would be greatly appreciated!
A finite field of order $q$ has cyclic multiplicative group of order $q^n-1$.
If $a\in\mathbb{F}_q$ is a root of $x^n-1$, then $a^n=1$; in particular, the multiplicative order of $a$ divides $n$. Conversely, if the multiplicative order of $a$ divides $n$, then $a^n=1$, hence $a$ is a root of $x^n-1$.
Thus, the roots of $x^n-1$ are precisely the elements of multiplicative order dividing $a$.
If $n|q-1$, then the multiplicative group of $\mathbb{F}_q$ has a unique subgroup of order $n$, and its elements are precisely the elements with multiplicative order dividing $n$; there are exactly $n$ of them, so $x^n-1$ has $n$ distinct roots.
Conversely, since the elements of multiplicative order dividing $n$ form a subgroup of the multiplicative group, if there are $n$ of them, then by Lagrange’s theorem you have that $n$ divides $q-1$.