Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 7.3 Exercise 7.3.5
Describe all ring homomorphisms from $\mathbb{Z} \times \mathbb{Z}$ to $\mathbb{Z}$. In each case, describe the kernel and the image.
Solution: Since $\mathbb{Z}^2$ is the free abelian group on two generators (cf. §6.3 #11), every additive group homomorphism $\varphi : \mathbb{Z}^2 \rightarrow \mathbb{Z}$ is determined uniquely by $\varphi(1,0)$ and $\varphi(0,1)$. Since every ring homomorphism is also and additive group homomorphism, if $\varphi : \mathbb{Z}^2 \rightarrow \mathbb{Z}$ is a ring homomorphism, then $\varphi$ is determined uniquely by $\varphi(1,0) = a$ and $\varphi(0,1) = b$.
Note that $$\varphi(1,1) = \varphi((1,0) + (0,1)) = \varphi(1,0) + \varphi(0,1) = a+b,$$ and on the other hand $$\varphi(1,1) = \varphi((1,1)(1,1)) = \varphi(1,1)\varphi(1,1) = (a+b)^2.$$ Thus we have that $a+b$ is (multiplicatively) idempotent in $\mathbb{Z}$. Thus $a+b \in \{0,1\}$.
Note that for all $(x,y) \in \mathbb{Z}^2$, we have $\varphi(x,y) = xa + yb$ and $$\varphi(x,y) = \varphi((1,1)(x,y)) = (a+b)(xa + yb);$$ thus $$\varphi(x,y) = xa+yb = (a+b)(xa+yb)$$ for all $x,y \in \mathbb{Z}$.
If $a+b=0$, then for all $(x,y) \in \mathbb{Z}^2$, we have $\varphi(x,y) = 0$. Thus $\varphi = 0$.
Suppose now that $a+b = 1$. Since $\varphi$ is a ring homomorphism, for all $(x,y), (z,w) \in \mathbb{Z}^2$, we have $$\varphi((x,y)(z,w)) = \varphi(x,y)\varphi(z,w) = (ax+by)(az+bw)$$ on one hand and $$\varphi((x,y)(z,w)) = \varphi(xz,yw) = axz+byw$$ on the other. Thus $$axz+byw = a^2xz + (xw+yz)ab + b^2yw$$ for all integers $x,y,z,w$.
Choosing $y = w = 0$ and $x,z \neq 0$, we see that $axz = a^2xz$, so that $a^2 = a$. Since $a$ is an integer, we have $a \in \{0,1\}$. Thus in fact $(a,b) \in \{(1,0), (0,1) \}$.
Thus there are precisely three ring homomorphisms $\varphi_{(a,b)} : \mathbb{Z}^2 \rightarrow \mathbb{Z}$, where $\varphi_{(a,b)}(1,0) = a$ and $\varphi_{(a,b)}(0,1) = b$, given by $(a,b) \in \{(0,0), (1,0), (0,1)\}$.
(1) If $\varphi = \varphi_{(0,0)}$, then clearly $\varphi = 0$. Thus $\mathsf{ker}\ \varphi = \mathbb{Z}^2$ and $\mathsf{im}\ \varphi = 0$.
(2) Consider $\varphi = \varphi_{(1,0)}$. It is clear that if $(x,y) \in 0 \times \mathbb{Z}$, then $\varphi(x,y) = 0$. Suppose now that $\varphi(x,y) = x = 0$; then $(x,y) \in 0 \times \mathbb{Z}$. Thus $\mathsf{ker}\ \varphi = 0 \times \mathbb{Z}$. Since $\varphi(1,0) = 1$, $\mathsf{im}\ \varphi = \mathbb{Z}$.
(3) Consider $\varphi = \varphi_{(0,1)}$. By an argument similar to the previous one, $\mathsf{ker}\ \varphi = \mathbb{Z} \times 0$ and $\mathsf{im}\ \varphi = \mathbb{Z}$.