In Proposition II.2.5b of Algebraic Geometry, Hartshorne claims that for any graded ring $S$, and for any homogeneous element $f\in S_+$, we have an isomorphism of locally ringed spaces $$\varphi:\left(D_+(f),\mathcal{O}_{\mathrm{Proj\,}S}\vert_{D_+(f)}\right)\to\mathrm{Spec\,}S_{(f)}.$$
My question is about his claim that $\varphi$ acts on topological spaces as a bijection. Note that he defines, for $\mathfrak{p}\in D_+(f)\subset\mathrm{Proj\,}S$, $$\varphi(\mathfrak{p}) = S_f\mathfrak{p}\cap S_{(f)}$$ which is prime by basic commutative algebra, and it is relatively easy to check that it is injective as well. But how do we show surjectivity? This is my work so far:
For $\mathfrak{q}\in\mathrm{Spec\,}S_{(f)}$, we let $\mathfrak{p} = \sqrt{S_f\mathfrak{q}}$, and provided $\mathfrak{p}$ is a homogeneous prime ideal such that $\mathfrak{p}\cap S_{(f)} = \mathfrak{q}$, then this gives us the necessary element of $D_+(f)$.
It is easy to see that $\mathfrak{p}$ must be homogeneous and that $\mathfrak{p}\cap S_{(f)} = \mathfrak{q}$ so that $\mathfrak{p}\ne S_f$. However, I'm struggling to show that $\mathfrak{p}$ is prime. What is the correct approach here?
I'm not sure if StackOverflow or StackExchange is the better place to ask this question, but it seems to be relatively technical for StackExchange, so I'm asking it here.