TITLE: Sum of primitive roots is congruent to $\mu(p-1)$ using Moebius inversion?
QUESTION [7 upvotes]: Wikipedia has the result that Gauss proved that for a prime number $p$ the sum of its primitive roots is congruent to $\mu(p − 1) \pmod{p}$ in Article 81. 
I read it, but is there a faster proof using Moebius inversion instead of case by case checking?
I tried the following:
Let $f(d)$ be the sum of all the $d$th roots of unity. Then I think we have
$$
\sum_{d\mid p-1}f(d)\equiv \sum_{x\in\mathbb{Z}_p^\times}x\equiv 0\pmod{p}
$$
since every element of $\mathbb{Z}_p^\times$ is a $d$th root of unity for some $d\mid p-1$. 
So I define $F(n)=\sum_{d\mid n}f(d)$. By Moebius inversion,
$$
f(n)=\sum_{d\mid n}\mu(d)F(n/d).
$$
The sum in question is the case where $n=p-1$, so
$$
f(p-1)=\sum_{d\mid p-1}\mu(p-1)F((p-1)/d)
$$
and I want to show this is congruent to $\mu(p-1)\pmod{p}$. Since $f(1)=1$, $F(1)=1$, so I'm just trying to show $F((p-1)/d)\equiv 0$ when $(p-1)/d\neq 1$ and I believe the result would follow. Does anyone know how to show that if it is true, or fix the argument otherwise?

REPLY [5 votes]: Here is a straightforward solution involving sums of roots of cyclotomic polynomials.
We work in some field $K$.
We show that the sum of the primitive $n$th roots of unity is $\mu(n)$. Here, we define the primitive $n$th roots of unity to be the roots of the cyclotomic polynomial $\Phi_n(x)$ in some fixed algebraic closure of $K$, counted with multiplicities. (This is important for the case of finite $K$; there, the notation is non-standard. Of course, when $K = \mathbb{F}_p$ and $n = p-1$, then the primitive $n$th roots of unity are precisely the primitive roots of $\mathbb{F}_p$, and all multiplicities are $1$.)
We proceed using strong induction. Let $S_n$ denote the sum of the primitive $n$th roots of unity. Our base case is: $\Phi_1(x)=x-1$, by Vieta's formulas so $S_1=1=\mu(1)$. Now, suppose the proposition holds for all $1\le n\le k-1$. We have $$x^k-1=\prod_{d|k}\Phi_d(x)=\prod_{d|k}(x^d-S_d x^{d-1}+\ldots) = x^k-cx^{k-1}+\ldots, $$ where $c=\displaystyle\sum_{d|k}S_d$. However, since $k\ge 2$, we have $\displaystyle\sum_{d|k}S_d=0$, which means $$S_k+\sum_{\substack{d|k;\\ d<k}}\mu(d)=S_k + \left(\sum_{d|k}\mu(d)\right)-\mu(k) = 0.$$ It follows that $S_k=\mu(k)$, since $\sum_{d|k}\mu(d)=0$. Thus the induction is complete.
It follows as a corollary that if $g_1, g_2,\ldots, g_{\varphi(p-1)}$ are the primitive roots mod $p$, then $$\sum_{i=1}^{\varphi(p-1)}g_i\equiv\mu(p-1)\pmod{p}.$$