Let $f,g:A \to B$ be two ring homomorphisms of noetherian rings satisfying that for any prime ideal $\mathfrak{q} \subset B$, $f^{-1}(\mathfrak{q})=g^{-1}(\mathfrak{q})=:\mathfrak{p}$ and the induced morphisms from $A/\mathfrak{p} \to B/\mathfrak{q}$ are the same. Is it true that $f=g$? If not true in general, is there any known additional conditions on $A$ or $B$, for which we have a positive answer to the question?


Any reference/hint will be most welcome.



Automorphisms of rings fixing all prime ideals
The condition just says that for each prime $\mathfrak{q}$ of $B$, both composite maps $A\rightrightarrows B\to B/\mathfrak{q}$ are equal. Hence for each $x\in A$, $f(x)-g(x)$ belongs to every prime of $B$, i.e. is nilpotent. 


The converse is clear, so your condition is equivalent to the equality of both composites $A\rightrightarrows B\to B\_\mathrm{red}$. No noetherian assumption is necessary.


