Characterization of ideals in rings of fractions
I don't believe in general you can say much about how ideals in $R$ are related to those in the localization. I will state two instances where we do have some correspondence:
Prime ideals:
The prime ideals of $S^{-1}R$ are in one to one correspondence with prime ideals of $R$ that don't meet $S.$ That is to say prime ideals $\mathfrak{p} \subset R$ such that $\mathfrak{p} \cap S = \emptyset$. The correspondence is given by $\mathfrak{p} \leftrightarrow S^{-1}\mathfrak{p}$. The proof of this fact is not hard, one direction is easy and for the other you just need to use the isomorphism $\overline{S}^{-1}(R/I) \cong S^{-1}R/S^{-1}I$. This isomorphism comes from applying $S^{-1}$ to the exact sequence
$$0 \longrightarrow I \longrightarrow R \longrightarrow R/I \longrightarrow 0$$
of $R$ - modules. By $\overline{S}$ I mean the image of $S$ in the quotient, which is still a multiplicative set.
Ideals $I\subset R$ such that $xs \in I$ implies that $x \in I$ for all $s \in S$:
It is not hard to show that for any ideal $J$ of $S^{-1}R$, we have that $(J^c)^e = J$ where $()^c$ denotes contraction, $()^e$ denotes extension. Now if we are given an ideal $I$ of $R$ instead, it is not true that $(I^e)^c = I$. What is true though (which is not hard to prove) is that
$$(I^e)^c = \{r \in R: rs \in I \hspace{2mm} \text{for some} \hspace{2mm} s \in S\}.$$
It is easy to see from here that the processes of extension and contraction define the following bijective correspondence:
$$\{ \text{ ideals $I$ of $R$ | $xs \in I \implies x \in I$ for all $s \in S$}\} \leftrightarrow \{ \text{ideals of $S^{-1}R$}\}.$$
Proposition: Let $R$ be a commutative ring with unity. Proper ideals of the ring of fractions $D^{-1}R$ are of the form $\displaystyle D^{-1}I = \bigg\{ \frac{i}{d} : i \in I,\ d \in D\bigg\}$ with $I$ an ideal of $R$ and $I \cap D = \emptyset$.
Proof: Let $J$ be a proper idea of $D^{-1}R$. Let $I = J \cap R$ and observe that $I$ is an ideal of $R$. Suppose to the contrary that $I \cap D \neq \emptyset$. Let $d \in I \cap D$ then $d \in I$. Observe that $\displaystyle \frac{d}{1} \in J$. Moreover, since $J$ is an ideal, it must absorb any element from $D^{-1}R$. Observe that $\displaystyle \frac1d \in D^{-1}R$. Hence it must follow that $\displaystyle \frac1d \cdot \frac{d}{1} = 1 \in J$ and thus $J$ contains a unit which implies $J = D^{-1}R$, a contradiction to $J$ being proper. Thus $I \cap D = \emptyset$.
Let $j \in J$. Observe that $\displaystyle j = \frac{i}{d} = \frac{1}{d}\frac{i}{1}$ for some $i \in R$, $d \in D$. Since $J$ is an ideal of $D^{-1}R$ it must absorb $\displaystyle \frac{d}{1}$ and thus $\displaystyle \frac{d}{1}\bigg(\frac{1}{d}\frac{i}{1}\bigg) = \frac{i}{1} \in J$. Now since $I = J \cap R$ and $\frac{i}{1} = i \in J \cap R$, it follows that $i \in I$. Hence $J \subseteq D^{-1}I$.
Let $x \in D^{-1}I$ where $\displaystyle x = \frac{i}{d}$ for some $i \in I$ and some $d \in D$. Since $i \in I = J \cap R$, then $i \in J$. Hence $x \subseteq D^{-1}I$.
Thus we can conclude that $J = D^{-1}I$.
As an example you might like to consider $R = \mathbb Z$ and $D = \{12^i : i = 0, 1, 2, \ldots\}$. You can see that $I = D^{-1}2\mathbb Z$ is not a proper ideal because you will get a unit with $r = 6$, $i = \frac{2}{12}$.
Proposition: Let $R$ be a commutative ring with unity. Prime ideals in $D^{-1}R$ are of the form $D^{-1}P$ where $P$ is a prime ideal of $R$ and $P \cap D = \emptyset$.
Proof:Suppose $Q$ is a prime ideal of $\displaystyle D^{-1}R = \bigg\{ \frac{r}{d} : r \in R,\ d \in D \bigg\}$. Set $P = Q \cap R$. Suppose to the contrary that $P \cap D \neq \emptyset$. Choose $d \in P \cap D$. Observe that $\frac{d}{1} \in Q$. Moreover $\frac1d \in D^{-1}R$. Since $Q$ is a prime ideal, it follows that $\frac1d \frac{d}{1} = 1 \in Q$ which implies that $Q = D^{-1}R$ a contradiction to $Q$ being a prime ideal, which by definition is proper. Hence $P \cap D = \emptyset$.
Let $q \in Q$. Then $q = \frac{r_1}{d_1}$ for $r_1 \in R$ and $d_1 \in D$. Observe that $\frac{d_1}{1} \in D^{-1}R$. So, py property of $Q$ being an ideal, $\frac{d_1}{1} \frac{r_1}{d_1} = \frac{r_1}{1} \in Q$ and since $P = Q \cap R$, then $r_1 \in P$. Hence we have $\frac{r_1}{1} \in D^{-1}P$. Thus $Q \subseteq D^{-1}P$.
Let $x \in D^{-1}P$. Then $x = \frac{p_1}{d_1}$ where $p_1 \in P$ and $d_1 \in D$. Since $P = Q \cap R$ and $p_1 \in P$ it follows that $p_1 \in Q$ so $x \in Q$. Hence $D^{-1}P \subseteq Q$.
Conclude that $Q = D^{-1}P$.