How to prove what element in $\mathbb{Z}_n$ you get when the elements of $\mathbb{Z}_n$ are summed? Based on trial and error I found that when $n$ is odd, the sum of the elements of $\mathbb{Z}_n$ is zero in $\mathbb{Z}_n$. When $n$ is even, the sum of the elements of $\mathbb{Z}_n$ is $n/2$ in $\mathbb{Z}_n$. Here is what I have so far for a proof:
Let k be an integer. Then k in $\mathbb{Z}_n$=k-$nm$, where $m$ is an integer such that $nm\leq$k and for any integer $t\ne$m, $nt$>k or $nt<nm$. The sum of the elements of $\mathbb{Z}_n$=$\frac{n-1}{2}n$. So the sum of the elements of $\mathbb{Z}_n$ in $\mathbb{Z}_n$ is $\frac{n-1}{2}n$-$nm$ which can be simplified to $\frac{n-1-2m}{2}n$.
I am not sure how to relate that to zero or n/2.

We may do the summing in the larger ring $\mathbb{Z}$ where we have
$$\sum_{k=0}^{n-1} k = \frac{(n-1)n}{2}.$$
If $n$ is odd, this is $\frac{n-1}{2} \cdot n \equiv 0$ modulo $n$.
If $n$ is even, this is $(n-1) \cdot \frac{n}{2} \equiv -\frac{n}{2} \equiv \frac{n}{2}$ modulo $n$.
