- Let $\phi: \mathbb{Z}_6 \rightarrow \mathbb{Z}_2$ be given by $\phi(x)=$the remainder of $x$ when divided by $2$, as in the division algorithm.
- Let $\phi: \mathbb{Z}_9 \rightarrow \mathbb{Z}_2$ be given by $\phi(x)=$the remainder of $x$ when divided by $2$, as in the division algorithm.
They seem trivial but I cannot prove them in detail. I claim that 1 is a homomorphism while 2 is not.
Question 2: We simply note that $$\phi(1+8)=0 \neq 1 = \phi(1) + \phi(8).$$
For question 1, I write a proof like this:
For any $a, b\in \mathbb{Z}_6$, write $a+b=c$. Note that
- $a$ is even, $b$ is even $\Rightarrow$ $c$ is even
- $a$ is odd, $b$ is odd $\Rightarrow$ $c$ is even
- $a$ & $b$ are of different parity $\Rightarrow$ $c$ is odd
We check that in all of the three cases, $\phi(a+b) = \phi(a)+\phi(b)$.
But I didn't make use of the assumption that $\phi$ is from $\mathbb{Z}_6$. In fact if I didn't take a careful look at the elements of $\mathbb{Z}_9$, I would just copy this proof to conclude that question 2 is a homomorphism! So, what is wrong with my proof? How can I improve it? Thanks in advance.
Your arguments are correct, and your observation and question are good. To lay your worries to rest you just need to realize that parity for elements in $\mathbb Z_n$ only makes sense when $n$ is even. Indeed, if $n$ is odd then for any $k\in \mathbb Z_n$, since $k=n+k$, but as integers they have different parities, it follows that you can't define the parity of elements in $\mathbb Z_n$, for $n$ odd. For $n$ even there is no problem and indeed your argument for $\mathbb Z_6$ generalizes easily.
It is possible to object to what I just said by defining parity in $\mathbb Z_n$ by simply looking at $\mathbb Z_n=\{0,1,2,3,\ldots \}$ and declaring these elements to be even or odd alternatively, starting with $0$ being even. This avoids referring to parity of integers. This is fine, but then the result that "the sum of two even elements in $\mathbb Z_n$ is even iff both elements have the same parity" is true iff $n$ is even. This again explains the behaviour you see.