Let $\phi: R \rightarrow S$ be a surjective homomorphism of rings. Prove that the image of the center of $R$ is contained in the center of $S$.
Which is from Dummit and Foote Exercise 7.3.16. I have no problem with the proof:
$\{z \in R | z\cdot r = r\cdot z \text{ for all $r \in R$ } \}$ is the center of $R$. Given $r$ in the center of $R$ then $\phi(r)\in S$ is in the center of $S$. Since $\phi$ is surjective, there exists $z \in R$ s.t. $\phi(z) =s$ for all $s\in S$, thus $s \cdot \phi(r) = \phi(z)\cdot \phi(r) = \phi(z\cdot r) = \phi(r\cdot z) = \phi(r) \cdot \phi(z) = \phi(r) \cdot s$ for all $s \in S$.
The problem I'm working on has an extra line tacked on to it:
Show that the statement is false when $\phi$ is not surjective.
Surjectivity is a sufficient condition and allowed us to prove the first part. If any false cases existed, then necessarily the homomorphism must not be surjective. Am I supposed to prove a counterexample? What if $R \subsetneq S$ and $i:R \rightarrow S$ is the inclusion mapping. Then $i$ is not surjective and the image of the center of $R$ must necessarily be contained in the center of $S$. So there exists a non surjective homomorphism whose image of the ring center is central.
Since the image of the center of $R$ necessarily commutes with every element in $\phi(R)$, it must be contained in the center of $\phi(R)$. The only rings I could think of, given the limited types I've been introduced to, that were noncommutative and had pockets of elements that were commutative between themselves were matrix rings and quaternions. Quaternions were a little harder to get what I wanted.
All I could come up with is $\phi: \mathbb{Z} \rightarrow M_2(\mathbb{Z})$, where $M_2(\mathbb{Z})$ is the set of all $2\times 2$ matrices with entries in $\mathbb{Z}$ and $$a \mapsto \begin{pmatrix} a & 0 \\ 0 & 0 \end{pmatrix} $$
Then $\phi(\mathbb{Z}) = \left\{ \begin{pmatrix} a & 0 \\ 0 & 0 \end{pmatrix}\Bigg| a\in \mathbb{Z} \right\} \nsubseteq \left\{ \begin{pmatrix} a & 0 \\ 0 & a \end{pmatrix}\Bigg| a\in \mathbb{Z} \right\}$. I extrapolated from here that the center of $M_2(\mathbb{Z})$ is $\left\{\begin{pmatrix} a & 0 \\ 0 & a \end{pmatrix}\Bigg| a\in \mathbb{Z} \right\}$.
Does this work as a counterexample? If so, is there a less trivial, more interesting example than this?