[guided]We now prove the cancellation fact that uses primitivity. Let $Q$ be a proper divisor of $q$. We group residue classes modulo $q$ according to their image modulo $Q$. For a residue class $a \in \mathbb{Z}/Q\mathbb{Z}$, define
\begin{align*}
S_a := \sum_{\substack{1\leq r\leq q \\ r\equiv a \!\!\!\pmod Q}} \chi(r).
\end{align*}
We want to prove $S_a=0$.
Why should [primitivity](/page/Primitive%20Dirichlet%20Character) imply this cancellation? Let
\begin{align*}
\rho:(\mathbb{Z}/q\mathbb{Z})^\times &\to (\mathbb{Z}/Q\mathbb{Z})^\times \\
[r]_q &\mapsto [r]_Q
\end{align*}
be the reduction homomorphism. We need a unit $u$ modulo $q$ that lies in $\ker\rho$ but on which $\chi$ is not equal to $1$. Suppose no such unit existed. Then $\chi$ would be trivial on $\ker\rho$.
We now show why that would contradict primitivity. Since $Q$ divides $q$, the reduction map $\rho$ is surjective. Write $q=\prod_{p\mid q}p^{\alpha_p}$ and $Q=\prod_{p\mid q}p^{\beta_p}$, with $0\leq \beta_p\leq \alpha_p$. Given a unit class $[a]_Q\in (\mathbb{Z}/Q\mathbb{Z})^\times$, require $b\equiv a\pmod {p^{\beta_p}}$ for each prime $p$ with $\beta_p>0$, and require $b\equiv 1\pmod {p^{\alpha_p}}$ for each prime $p$ with $\beta_p=0$. The moduli involved are pairwise coprime, so the [Chinese Remainder Theorem](/page/Chinese%20Remainder%20Theorem) produces an integer $b$ satisfying all these congruences. This integer satisfies $b\equiv a\pmod Q$, and it is not divisible by any prime dividing $q$, so $\gcd(b,q)=1$. Thus $\rho$ is surjective. Hence, if $\chi$ is trivial on $\ker\rho$, we may define
\begin{align*}
\psi:(\mathbb{Z}/Q\mathbb{Z})^\times &\to \mathbb{C}^\times \\
\rho([r]_q) &\mapsto \chi(r).
\end{align*}
This definition is independent of the chosen lift $[r]_q$: if two lifts $[r]_q$ and $[s]_q$ have the same image modulo $Q$, then $[r]_q[s]_q^{-1}\in\ker\rho$, and triviality on $\ker\rho$ gives $\chi(r)=\chi(s)$. The map $\psi$ is multiplicative because $\chi$ is multiplicative. Extending $\psi$ to all integers by the Dirichlet-character convention $\psi(m)=0$ when $\gcd(m,Q)>1$ gives a character modulo $Q$ inducing $\chi$ on the unit classes modulo $q$. This contradicts the assumption that $\chi$ is primitive modulo $q$. Therefore there exists an integer $u$ such that
\begin{align*}
\gcd(u,q)=1,\qquad u\equiv 1\pmod Q,\qquad \chi(u)\neq 1.
\end{align*}
Now consider multiplication by this $u$. Since $\gcd(u,q)=1$, multiplication by $u$ is a permutation of the residue classes modulo $q$. Since $u\equiv 1\pmod Q$, it preserves each fibre over modulo $Q$: if $r\equiv a\pmod Q$, then $ur\equiv r\equiv a\pmod Q$. Therefore multiplication by $u$ permutes the finite set of residues modulo $q$ satisfying $r\equiv a\pmod Q$.
Using this permutation in the sum defining $S_a$, we get
\begin{align*}
S_a
&=
\sum_{\substack{1\leq r\leq q \\ r\equiv a \!\!\!\pmod Q}} \chi(ur).
\end{align*}
By multiplicativity of the Dirichlet character,
\begin{align*}
\chi(ur)=\chi(u)\chi(r)
\end{align*}
for every integer $r$. Hence
\begin{align*}
S_a
&=
\chi(u)\sum_{\substack{1\leq r\leq q \\ r\equiv a \!\!\!\pmod Q}} \chi(r) \\
&=
\chi(u)S_a.
\end{align*}
Since $\chi(u)\neq 1$, subtracting $\chi(u)S_a$ from both sides gives
\begin{align*}
(1-\chi(u))S_a=0,
\end{align*}
and therefore $S_a=0$.[/guided]