About the Zariski topology on the spectrum of localization Let $R$ be a (commutative) ring, $S=\{1,f,f^2,\dots\}$. The exercise I'm working on is asking to show that $Spec(S^{-1}R)$ is an open subset of $Spec R$ and that the Zariski topology on $Spec(S^{-1}R)$ is the subspace topology induced by inclusion in $Spec(R)$.
Let $\pi:R\to S^{-1}R$ be the localization homomorphism. It induces a continuous map $Spec(\pi):Spec(S^{-1}R)\to Spec(R)$. $Spec(\pi)$ is defined as follows: any prime ideal in $S^{-1}R$ is of the form $S^{-1}P$ for some prime ideal $P$ in $R$ such that $P\cap S=\emptyset$. Define $Spec(\pi):S^{-1}P\mapsto \pi^{-1}(S^{-1}P)=P$. The image of $Spec(\pi)$ is the set $\{\pi^{-1}(S^{-1}P) \in Spec(R): S^{-1}P\in Spec(S^{-1}R) \}=\{P\in Spec(R):P\cap S=\emptyset\}$ (correct me if I'm wrong).
From the comments in this question, I know that what the questions above really mean is that
(1) The image of the map $Spec(\pi)$ is an open subset of $Spec(R)$
(2) The subspace topology on the image of $Spec(\pi)$ (induced by inclusion to $Spec(R)$) coincides with the topology on the image of $Spec(\pi)$ that is given as follows: $U\subset im(Spec(\pi))$ is closed iff $Spec(\pi)^{-1}(U)$ is closed in $Spec(S^{-1}R)$.

(1): My conjecture is that $im(Spec(\pi))=Spec(R)\setminus V(S)$, but I only managed to prove one inclusion.
Suppose $P\in im(Spec(\pi))$, i.e., $P\in Spec(R)$ and $P\cap S=\emptyset$. Then we must have $P\in Spec(R)\setminus V(S)$. Indeed, this last fact means that $P\in Spec (R)$ and $S\not\subset P$. But we already know this, since $S\cap P=\emptyset$.
For the other direction, I believe we need to use that $S=\{1,f,\dots\}$, but I'm not sure how. Suppose $P\in Spec(R)\setminus V(S)$. So $P\in Spec(R)$ and $S\not\subset P$. I need to show that $S\cap P=\emptyset$. But this needn't be true even if $S=\{1,f,\dots\}$, right? If $R=\mathbb Z, P=(2)$, and $f=2$, then $S\cap P\ni 2$. Am I using the wrong argument?

(2) Here I also need to prove two inclusions of sets. First, suppose $U\subset im(Spec(\pi))$ is closed in the sense that $Spec(\pi)^{-1}(U)$ is closed in $Spec(S^{-1}R)$. To prove that $U$ is closed in the subset topology, I need to prove that there is a closed set $V(T)\subset Spec(R)$ such that $U=im(Spec(\pi))\cap V(T)$.
Let's use that the preimage of $U$ under $Spec(\pi)$ is closed. This means that $Spec(\pi)^{-1}(U)=V(S^{-1}\widetilde T)$ for some subset $S^{-1}\widetilde T\subset S^{-1}R$. So I need to prove that $$Spec(\pi)(V(S^{-1}\widetilde T))=\{P\in Spec R: P\cap S=\emptyset \}\cap \{P\in Spec R: T\subset P\}$$ for some $T\subset R$. The first thought is to try taking $T=\widetilde T$. But I'm having trouble checking/proving this. I found that I'm confused about what the LHS of the above displayed equality is ($Spec(\pi)$ is supposed to send $S^{-1}P$ (where $S\cap P=\emptyset$) to $P$, but what about those $S^{-1}P$ for which $S^{-1}\widetilde T\subset S^{-1}P$?..
There's also the other inclusion that needs to be proved in (2), but I'm not sure if it's worth attempting it until I figure out how to deal with this one.
This problem is supposed to be easy, I'm probably over-complicating things too much.
 A: While I don't think you're overcomplicated it, I think there are some facts which you may be missing which simplify this kind of problem.
Let $R$ be a communitive ring with unity and $S$ as defined before. Then, it is a general fact that there is a bijective order preserving bijection between prime ideals of $S^{-1}R$ and those of $R$ not meeting $S$. This is true for any multiplicative set $S$ and the correspondence is given by $\mathfrak{p} \mapsto i^{-1}(\mathfrak{p})$ where $i: R \to S^{-1}R$ is the localization map. You can either do this yourself as an exercise or you can find a proof in Atiyah-Macdonald Proposition 3.11.
Let's call this set of (prime ideals of $R$ not meeting $S$) $U \subseteq \operatorname{Spec} R$. Note that the correspondence above is exactly the induced map $\operatorname{Spec} S^{-1}R \to \operatorname{Spec} R$. Hence, this function is a bijection onto its image. Moreover, since it is order preserving, it is a homeomorphism onto its image.
I'll leave it to you to show that this is a homeomorphism but I will sketch out the main ideas. You can factor the map $\operatorname{Spec} S^{-1}R \to \operatorname{Spec} R$ through its image to obtain a bijective continuous map $\operatorname{Spec} S^{-1}R \to U$ given by $\mathfrak{p} \mapsto i^{-1}(\frak{p})$. Then, to show it is a homeomorphism it suffices to show it is a closed map. If $V(\mathfrak{p}) \subseteq \operatorname{Spec} S^{-1} R$, its image in $U$ is exactly $V(i^{-1}(\mathfrak{p}) )\cap U$. Hence, $\operatorname{Spec} S^{-1}R \to U$ given by $\mathfrak{p} \mapsto i^{-1}(\frak{p})$ is a bijective, closed, continuous map and hence a homeomorphism.
Hence, we just need to find what $U$ is. Your conjecture is correct, and we can improve it slightly. We claim that $U = \operatorname{Spec} R \setminus V(f)$. This is easy by our definition of $U$. If $\mathfrak{p} \in U$, then $\mathfrak{p} \cap S = \emptyset$ so $f \notin \mathfrak{p}$. Conversely, if $f \notin \mathfrak{p}$, then $S \cap \mathfrak{p} = \emptyset$ so that $\mathfrak{p} \in U$. The reason that $S \cap \mathfrak{p} = \emptyset$ is that $\mathfrak{p}$ is prime so $1 \notin \mathfrak{p}$ and if $f^k \in \mathfrak{p}$, then $f \in \mathfrak{p}.$
In the bigger picture, sets of the form $\operatorname{Spec} R \setminus V(f)$ are called basic open sets (denoted $D(f)$) and are extremely important. Their name comes from the fairly straightforward fact ( and good exercise :) ) that such sets form a basis for the topology of $\operatorname{Spec} R$.
Lastly, as a note of caution, the image of the induced map $\operatorname{Spec} S^{-1} R \to \operatorname{Spec} R$ is not always open. As you did, consider $\operatorname{Spec} \mathbb{Z}_{(2)} \to \operatorname{Spec} \mathbb{Z}$ (where we localize at the prime ideal $(2)$ and not the multiplicative set $\{1, 2, 4, \dots, \}$). This map is still a homeomorphism onto its image but the image is the set $\{(0), (2)\} \subseteq \operatorname{Spec} \mathbb{Z}$. This set is not open or closed.
