$\mathfrak p$ is prime ideal of commtative ring $R$. localization $R_{\mathfrak p}:=(R-{\mathfrak p})^{-1}R$.
We know $\mathfrak pR_{\mathfrak p}=(R-{\mathfrak p})^{-1}\mathfrak p$ is prime ideal of $R_{\mathfrak p}$. Define $\mathfrak q ^c:=\{r\in R\ |\ \frac r1\in \mathfrak q\}$.
Suppose ${\mathfrak q}$ is prime ideal of $R_{\mathfrak p}$, if we have $\color{blue}{\mathfrak q ^c \cap\ (R-{\mathfrak p})=\varnothing}$, then $\mathfrak q^c\in \mathfrak p, \mathfrak q\in \mathfrak pR_{\mathfrak p}$.
So $\mathfrak pR_{\mathfrak p}$ is the only maximal ideal of $R_{\mathfrak p}$.
So how to prove $\mathfrak q ^c \cap\ (R-{\mathfrak p})=\varnothing$ ? Thanks in advance.
The exercise asks you to prove that $\mathfrak{p}R_{\mathfrak{p}}$ is the only maximal ideal of $R_{\mathfrak{p}}$, so starting with a prime ideal $\mathfrak{q}$ is not the best way (the ring $R_{\mathfrak{p}}$ can actually have other prime ideals).
Let $r/s$ be an element of $R_{\mathfrak{p}}$ that's not in $\mathfrak{p}R_{\mathfrak{p}}$. Then $r\notin\mathfrak{p}$, otherwise $$ \frac{r}{s}=\frac{r}{1}\frac{1}{s}\in\mathfrak{p}R_{\mathfrak{p}} $$ by definition. Then $s/r\in R_{\mathfrak{p}}$ and so $r/s$ is invertible. Therefore an ideal of $R_{\mathfrak{p}}$ properly containing $\mathfrak{p}R_{\mathfrak{p}}$ contains a unit and so it is the whole ring.
There's however another fact to verify, namely that $\mathfrak{p}R_{\mathfrak{p}}\ne R_{\mathfrak{p}}$. This is equivalent to showing that $1/1\notin\mathfrak{p}R_{\mathfrak{p}}$. Suppose the contrary; then $$ \frac{1}{1}=\frac{r}{s} $$ for some $r\in\mathfrak{p}$ and $s\in R-\mathfrak{p}$. This amounts to saying that there exists $t\in R-\mathfrak{p}$ such that $(s-r)t=0$, that is, $rt=st$ which is impossible because $rt\in\mathfrak{p}$ and $st\notin\mathfrak{p}$, the latter due to $\mathfrak{p}$ being a prime ideal and $s,t\notin\mathfrak{p}$.