Why is the sum modulo n of elements in $\mathbb{Z}_n^*$ equal to 0?

Your remark is what you need.

Assume that $a \in \mathbb{Z}_n^*$ and some integer $k > 1$ divide both $n-a$ and $n$. Then $k$ would divide their difference $n - (n-a) = a$. Hence $k$ divide $n$ and $a$ and hence $a$ cannot belong to the set. Thus $n-a \in \mathbb{Z}_n^*$

Now you just need to observe that $a + (n-a) = n = 0$ in $\mathbb{Z}_n^*$ and $$ \sum_{a \in \mathbb{Z}_n^*} a = \sum_{a \in \mathbb{Z}_n^*, a < n/2} (a + n-a) = 0. $$


This is an edit of my previous answer.

The following proof is incomplete and more complex than the simple argument that uses the simmetry $a\to-a$ of $\Bbb Z_n^\times$ employed, but is possibly the simplest case of a useful argument.

Assume first that $n=p$ is a prime. Let $x\in\Bbb Z_p^\times$. The multiplication by $x$ (i.e. the map $a\mapsto ax$) defines a permutation of $\Bbb Z_p$ which restricts to a permutation of $\Bbb Z_p^\times$. Therefore $$ \sum_{a\in\Bbb Z_p^\times}a= \sum_{a\in\Bbb Z_p^\times}(xa)= x\sum_{a\in\Bbb Z_p^\times}a. $$ If $n\neq2$ we can always choose $x\neq1$ and the above identity shows that $\sum_{a\in\Bbb Z_p^\times}a$ must be $0$.

If $n$ is not prime the problem is that a congruence $$ xA\equiv A\bmod n\qquad\qquad(*) $$ does not imply $A\equiv 0\bmod n$ even when $x\neq1$ is invertible in $\Bbb Z_n$ because $A$ may not be cancelled. The latter situation happens when $A\notin\Bbb Z_n^\times$, i.e. ${\rm gcd}(A,n)>1$.

So, assume $A\not\equiv0\bmod n$ and write $d={\rm gcd}(A,n)$, $A=Bd$ and $n=dm$ and note that ${\rm gcd}(B,m)=1$. The congruence $(*)$ becomes $$ xB\equiv B\bmod m $$ which now implies $x\equiv1\bmod m$ because $B\in\Bbb Z_m^\times$. But the latter conclusion contradicts the possibility to choose $1\neq x\in\Bbb Z_m^\times$ when $m\neq2$, which is guaranteed by the fact that the canonical map $$ \Bbb Z_n^\times\longrightarrow\Bbb Z_m^\times $$ is surjective.

In particular this proves the result when $n$ is odd and leaves open the only possibility that $$ \sum_{a\in\Bbb Z_{2m}^\times}a=m $$ in $\Bbb Z_{2m}$.


If $d$ divides both $n-a$ and $n$ then it divides their difference, $n-(n-a)$, which is $a$.


Every common divisor of $n-a$ and $n$ is also a common divisor of $a$ and $n$. This shows that if $a$ is in $(\mathbb Z/n\mathbb Z)^\times$ then also $n-a$ is in this set. The pair $(a,n-a)$ sums up to $n$ which is congruent to $0$ modulo $n$. Also, the numbers $a$ and $n-a$ are distinct since $a \equiv n-a \pmod n$ would imply $n|2a$, hence $n|2$ (because $n$ and $a$ are coprime). For $n\neq 2$ this is a contradiction. For $n=2$, however, the statement is actually false since $(\mathbb Z/2\mathbb Z)^\times = \{1\}$ which does not sum up to $0$ modulo $2$.