Let $\xi_n$ denote a primitive $n^{th}$ root of unity and let $K=\mathbb{Q}(\xi)$ be the associated cyclotomic field. Let $a$ denote the trace of $\xi_n$ from $K$ to $\mathbb{Q}$. Prove that $a=1$ if $n=1$, $a=0$ if $n$ is divisible by the square of a prime, and $a=(-1)^r$ if $n$ is the product of $r$ distinct primes. It is actually the
I know that the trace of $\xi_n$ from $K$ to $\mathbb{Q}$ is the sum of all primitive roots of $n$.
If $n=1$, it is very easy.
I know the fact that $a$ is a primitive root of $n$, then $-a$ is a primitive of $n$ as well if $n$ is divisible by the square of a prime. How to prove that? This is the key to prove the second case.
For the third case, I totally had no idea.
How to prove the two cases using theorems about the cyclotomic field or cyclotomic polynomial?