$f: G \to \mathbb{C}^*$ is a homomorphism. Show that the sum $\sum f (g) = 0$ or $n$
It is not necessary that $G$ be abelian, to wit:
If
$f(g) = 1, \; \forall g \in G, \tag 1$
then clearly
$\displaystyle \sum_{g \in G} f(g) = n, \tag 2$
since
$o(G) = n; \tag 3$
if
$\exists h \in G, \; f(h) \ne 1, \tag 4$
then since
$hG = G, \tag 5$
we have
$$\begin{align} \sum_{g \in G} f(g) &= \sum_{g \in G} f(hg) \\ &= \sum_{g \in G} f(h)f(g) \\ &= f(h)\sum_{g \in G} f(g); \tag 6 \end{align}$$
with $f(h) \ne 1$ this forces
$\displaystyle \sum_{g \in G} f(g) = 0. \tag 7$
$OE\Delta$.