I was trying to solve the following exercise:
Let $f\colon R\to S$ be a ring epimorphism, $I \subseteq S$ be an ideal, and $J = f^{-1}(I)$. Check that if $I$ is maximal (resp. prime) then $J$ is also maximal (resp. prime).
I had no trouble with the prime part, but I'm having a bit of trouble checking the maximal part. I think I am close, though.
Let $J \subseteq J' \subseteq R$ be another ideal. Then $f(J) \subseteq f(J') \subseteq f(R)$. Since $f$ is an epimorphism, this actually reads $I \subseteq f(J') \subseteq S$, with $f(J')$ being an ideal (again using surjectivity). Since $I$ is maximal, we have that $f(J')$ is either $I$ or $S$.
If $f(J')= I$, then $x \in J' \implies f(x) \in f(J') = I \implies x \in f^{-1}(I) = J$, and $J' = J$.
If $f(J') = S$, then $x \in R \implies f(x) \in S = f(J') \implies x \in f^{-1}(f(J))$, but I can't conclude that $x \in J$ from here ($f$ need not be injective).
Help?
We do not assume that rings are commutative and have $1$.
Editted to remove reference to unity
Continuing along the lines of your solution, we want to show that every $y \in R$ is also in $J'$. Note in particular, since the assumption is that $f(J')=S$, that there exists $x \in J'$ so that $f(x) = f(y)$. But then $$f(x-y)=f(x)-f(y)=0,$$ so $$x-y \in J = f^{-1}(I).$$ Can you see what to do from here?