In my abstract algebra book, there are two exercises on proofs with $\overline{a}=\overline{-a}$ in $\mathbb{Z}/n\mathbb{Z}$.
- If $n$ is odd, then $\overline{a}=\overline{-a} \iff \overline{a}=\overline{0}$.
- If $n$ is even, then $\overline{a}=\overline{-a} \iff \overline{a}=\overline{0}\text{ or }\overline{a}=\overline{n/2}$
I get very confused by these proofs, since they seem so elementary and yet I don't know how to prove them.
For the first one I did ''$\Rightarrow$'' like this: $\overline{a}=\overline{-a}\implies \overline{2a}=\overline{0} \implies n\mid 2a$. Since $\operatorname{gcd}(n,2)=1$ because $n$ is odd, we have $n\mid a$ so $\overline{a}=\overline{0}$. And ''$\Leftarrow$'' like this: $\overline{a}=\overline{0}$ implies $a=kn$ for some $k$, and so $-a=-kn$. We have $n\mid a-(-a)=2kn$ therefore $\overline{a}=\overline{-a}$.
Now for the second one, I have no idea what to do with the two separate cases. Could someone help?
For the second one, take a representative $a\in\mathbb{Z}$ such that $0<a<n$ (the fact that $\overline{0}=\overline{-0}$ is obvious).
Now, if $\overline{a}=\overline{-a}$, then $n|2a$, so $2a=nq$ for some $q\in \mathbb{Z}$. Since $0<2a<2n$, $q=1$ and $2a=n$.