Unique maximal ideal and ring epimorphism kernel with prime numbers equivalence Let $A$ be a ring. Let $f: \mathbf{Z} \to A$ be a surjective ring homomorphism. Prove that $A$ has a unique maximal ideal iff there exists $n\in \mathbf{N}$ and $p\in\mathbf{N}$ a prime number such that $\ker f =(p^{n})$.
$(p^{n})$ denotes the ideal generated by $p^{n}$, I'm not sure if that's the standard notation.
We had to prove that in a recent exam and nobody could prove it. I haven't found it online neither. Thank you!

I assume by 'ring epimorphism' you mean 'surjective ring homomorphism'. Since $f$ is surjective we have $A\cong \Bbb Z/\ker f$. We know that the maximal ideals of $\Bbb Z/\ker f$ correspond bijectively to the maximal ideals of $\Bbb Z$ containing $\ker f$, hence $A$ has a unique maximal ideal iff there is a unique maximal ideal of $\Bbb Z$ containing $\ker f$. Now use the fact that $\Bbb Z$ is a PID.
