Why is the map $ D(f) \rightarrow \text{Spec}(R_{f}) $ continuous? Let $ R $ be a commutative ring and $ D(f) = \lbrace \mathfrak{p} \in \text{Spec}(R) \;|\; f \notin \mathfrak{p} \rbrace. $
I am having difficulty showing that $ \psi_{f}: D(f) \rightarrow \text{Spec}(R_{f}) $ is continuous.
Any help would be appreciated.

Hint:
A basis of open sets in $\operatorname{Spec}R_f$ is the set of $D_{g/1}$. Show that
$$\psi_f^{-1}\bigl(D_{g/1}\bigr)=D_f\cap D_g=D(fg).$$
