I have a problem when I am proving the following question:
Let $f:A \to A'$ be a surjective homomorphism of rings, and assume that $A$ is local, $A' \neq 0$, show that $A'$ is local.
I have found an answer in this question. However in my proof, suppose that $\mathfrak{m}$ is the unique maximal ideal in $A$, and I have proved that $f(\mathfrak{m})$ is an ideal and contains any other ideals. To finish this proof, I should prove $f(\mathfrak{m})\neq A'$. But I can't prove $f(1)\notin f(\mathfrak{m})$.
For example, let $g:\mathbb{Z}\oplus \mathbb{Z} \to \mathbb{Z}$ be the natural projection onto its first coordinate. We know $\mathbb{Z}\oplus 2\mathbb{Z}$ is a maximal ideal in $A$, but $g((1,1)) \in g(\mathbb{Z}\oplus 2\mathbb{Z})$.So it's not true for a general ring.
Is there any direct way to prove $f(1)\notin f(\mathfrak{m})$ for a local ring?