An exercise in Hilton/Stammbach's A Course in Homological Algebra reads: "Let $\Phi$ associate with each commutative unitary ring $R$ the set of its prime ideals. Show that $\Phi$ is a contravariant functor from the category of commutative unitary rings to the category of sets. Assign to the set of prime ideals of $R$ the topology in which a base of neighborhoods is given by the sets of prime ideals containing a given ideal $J$, as $J$ runs through the ideals of $R$. Show that $\Phi$ is then a contravariant functor to the category of topological spaces."
Having studied prime spectra a little bit, I thought I knew where this exercise was going, but the topology the authors describe is different from the Zariski topology, where the sets $V(J)$ for $J$ an ideal of $R$ form the closed sets, not a basis of open sets. Is this a mistake in the book, or is what they describe another useful topology to put on the set of prime ideals of $R$?
The sets $V(I) = \{\mathfrak{p} : I \subseteq \mathfrak{p}\}$ are usually not closed under unions (thus are not the open sets of a topology), but the exercise just states that this is a base of a topology, which is certainly true. Of course, this is not the Zariski topology, since in that topology the sets $V(I)$ are usually not open. For any ring homomorphism $\varphi : R \to S$ the induced map $\mathrm{Spec}(\varphi) : \mathrm{Spec}(S) \to \mathrm{Spec}(R)$ satisfies $\mathrm{Spec}(\varphi)^{-1}(V(I)) = V(\varphi(I) \cdot S)$, showing that it is also continuous with respect to this alternative topology.
By the way, one can put this topology in the context of Yves Diers' theory in Une construction universelle des spectres topologies spectrales et faisceaux structuraux. (For a more recent account, see Osmond's papers On Diers's theory I and II.) This paper shows that a functor $U : \mathcal{A} \to \mathcal{B}$ satisfying certain conditions gives rise to a spectrum construction: Every object $B \in \mathcal{B}$ yields a topological space $\mathrm{Spec}_U(B)$ together with a $\mathcal{B}$-valued sheaf whose stalks have distinguished $U$-preimages. The classical case is the inclusion $\mathbf{LCRing} \hookrightarrow \mathbf{CRing}$ from the category of local commutative rings into the category commutative rings, which gives the locally ringed space $\mathrm{Spec}(B)$ of a commutative ring $B$. But the inclusion functor $\mathbf{Int} \hookrightarrow \mathbf{CRing}$ from integral domains and injective ring maps also satisfies the assumption. The spectrum of $B \in \mathbf{CRing}$ here is the set of prime ideals of $B$, but equipped with the topology whose basis are the sets $V(I)$, the structure sheaf is the sheaf associated to $V(I) \mapsto B/\sqrt{I}$, and its stalk at $\mathfrak{p}$ is the integral domain $B/\mathfrak{p}$.