Induced maps between spectra Let $f:A\to B$ be a ring homomorphism. If $f^{-1}$ induces a bijection between the ideals of $B$ and a set $U$ of ideals of $A$, and this bijection reflects the inclusion (and reflects the property of being prime), can I conclude that $\operatorname {Spec}f$ is an homeomorphism between $\operatorname {Spec} B$ and $U\cap\operatorname {Spec} A$?
From the hypothesis is immediate that $\operatorname {Spec} f$ induces a (continuous) bijection between $\operatorname {Spec} B$ and $U\cap\operatorname {Spec} A$; to prove that is closed in the image one can use that, for an ideal $I\subseteq B$ and a closed $V(I)$, $$\mathfrak p \in \operatorname{Spec}f (V(I))\iff f(\mathfrak p)\subseteq I, \mathfrak p\in U \iff \mathfrak p \subseteq f^{-1} (I),\mathfrak p\in U\iff \mathfrak p \in V(f^{-1}(I))\cap U.$$ Is my arguement correct? If yes, are there notable examples of homomorphisms $f$ with the mentioned properties, other than the projection $A\to A/I$ and the canonical homomorphism $A\to S^{-1} A$?
 A: One correct claim that can be proven is that if $f:A\to B$ is a homomorphism of rings so that $f^{-1}$ reflects containment of ideals (ie $f^{-1}(I)\subset f^{-1}(J)$ implies $I\subset J$), then the induced map on spectra $\def\Spec{\operatorname{Spec}}\Spec B\to\Spec A$ is a homeomorphism on to its image. Here's how:

*

*The map $\varphi:\Spec B\to \Spec A$ is continuous: the preimage of some $V(I)$ for $I\subset A$ is $V(f(I)B)$, so the preimage of a closed set is closed (this is general for any map of rings).

*The map $\varphi$ is injective: if $\mathfrak{q}_1,\mathfrak{q}_2\subset B$ are prime ideals with $f^{-1}(\mathfrak{q}_1)=f^{-1}(\mathfrak{q}_2)=\mathfrak{p}$ a prime ideal of $A$, then since $f^{-1}$ reflects containment we see that $\mathfrak{q}_1=\mathfrak{q}_2$. Therefore $\varphi$ is a bijection on to its image.

*The map $\varphi:\Spec B\to \varphi(\Spec B)$ is closed. Suppose $\mathfrak{p}\subset A$ is in the image of $\varphi$, that is, there exists a prime ideal $\mathfrak{q}\subset B$ with $f^{-1}(\mathfrak{q})=\mathfrak{p}$. Further, suppose that $\mathfrak{p}$ is in the closure of $\varphi(V(I))$ for some ideal $I\subset B$. As $\overline{\varphi(V(I))}=V(f^{-1}(I))$ for any map of rings (where the closure is taken in $\Spec A$), we see that $f^{-1}(I)\subset f^{-1}(\mathfrak{q})$, and as $f^{-1}$ reflects containment we must have $I\subset\mathfrak{q}$. Therefore $\mathfrak{q}\in V(I)$ and $\varphi(V(I))$ is closed in $U$. (This looks to be approximately what you've written, but I don't find your presentation to be so clear - maybe that's my fault.)

*A continuous closed bijection is a homeomorphism, so $\varphi:\Spec B\to \varphi(\Spec B)$ is a homeomorphism.

Note that if we drop this assumption about reflecting containment, we get counterexamples: if $R$ is a discrete valuation ring with maximal ideal $\mathfrak{m}$, then the map $f:R\to R/\mathfrak{m}\times \operatorname{Frac}(R)$ is a continuous bijection which is not a homeomorphism and $f^{-1}$ does not reflect containment. (This is noted in the other answer and its comments.)
As far as a characterization of what sort of maps of rings have this property other than (compositions of) localizations and quotients, I'm not sure that there is a well-known description. Any such map will be an epimorphism of rings, and there's a seminar by Samuel about these that I'm aware of but have not dug in to much. Some of the examples here should satisfy your assumptions and also give you an idea that this is maybe not such a simple condition to classify.
A: No, continuous bijections are not homeomorphisms, even if they come from ring homomorphisms. For example, if $A$ is an integral domain with two prime ideals $0$ and $\mathfrak p$, $K$ is its field of fractions and $k = A/\mathfrak p$ then the ring homomorphism $f : A \to K \times k$ given by $f(x) = (x+\mathfrak p , x)$ gives a continuous bijection but not a homeomorphism.
This is because $\text{Spec } A $ and $\text{Spec } K \times k $ are both spaces of two points (you can clearly see that $f^{-1}$ is surjective between them, so it is bijective), but $\text{Spec } A $ has the topology given by $\{\emptyset, \{0\}, \{0, \mathfrak p\}\}$ while $\text{Spec } K \times k $ has the discrete topology
