Sum of all elements in congruence class modulo n With $+$ defined as $[a]+[b]=[a+b]$, show that $[0]+[1]+\cdots+[n-1]$ is equal to either $[0]$ or $[n/2]$ in $\Bbb Z_n$.
How do I go about proving this? I have managed to get $[(n^2-n)/2]$ using the definition but how do I proceed from here to the result? 
Help would be much appreciated, thanks in advance!

If $n=2k+1$ is odd, $\left[\dfrac{n(n-1)}2\right]=[nk]=[0]$.
If $n=2k$ is even, $\left[\dfrac{n(n-1)}2\right]=[k(n-1)]=[-k]$.
