Two different ways of presenting the ring of S-integers Ok, first, here is my question:
Let $O$ be a Dedekind domain, $K$ its quotient field and let $S$ be a finite set of prime ideals in $O$. Let
$A:=\{x\in K: \forall\mathfrak{p}\not\in S\ (v_\mathfrak{p}(x)\geq0) \}$
and
$B:=\{\frac{f}{g}\in K:\forall\mathfrak{p}\not\in S\ (g\not\equiv0\text{ mod }\mathfrak{p})\}$
Now my question is: why are the same?
Clearly, $B\subseteq A$ holds, because $v_\mathfrak{p}(\frac{f}{g})=v_\mathfrak{p}(f)-v_\mathfrak{p}(g)=v_\mathfrak{p}(f)\geq0$ as $v_\mathfrak{p}(g)=0$ and $f\in O$. But how does one argue for the converse? I am somehow stuck... I strongly guess that the argument should be fairly easy... something like: if $v_\mathfrak{p}(\frac{f}{g})\geq0$ then there exist $f^\prime, g^\prime$ such that $\frac{f}{g}=\frac{f^\prime}{g^\prime}$ and $g^\prime\not\equiv0\text{ mod }\mathfrak{p}$.
In order to get the context right: $A$ is what usually is called the ring of $S$-integers (well, I know that what I wrote is a little bit out of context since usually one only considers the case where $O=O_K$ for a number field $K$ but I hope that everybody is fine with that). To make the context more precise, the definition of $A$ is basically from:


*

*Neukirch, Schmidt, Wingberg: Cohomology of Number Fields, Ch. VIII, § 3


and the definition of $B$ is from


*Neukirch: Algebraic Number Theory, Ch. I, § 11

 A: Just for a completion, I give an answer to my question myself which was in fact already answered in the comments thanks to Mathmo123. The argument is basically as already indicated in the question: take $x\in K$ such that $v_\mathfrak{p}(x)\geq0$. In order to find $f^\prime,g^\prime\in O$ such that $x=\frac{f^\prime}{g^\prime}$ and $g^\prime\not\equiv0\text{ mod }\mathfrak{p}$, by unique factorization in $O$ (and hence of fractional ideals over $K$), we can write $(x)=\mathfrak{a}\mathfrak{b}^{-1}$ with ideals $\mathfrak{a}$ and $\mathfrak{b}$ such that $\mathfrak{p}\mid\mathfrak{a}$ and $\mathfrak{a}+\mathfrak{b}=O$. This means that $\mathfrak{a}$ and $\mathfrak{b}$ differ only by a fractional principal ideal; hence, the classes $\overline{\mathfrak{a}}$ of  $\mathfrak{a}$ and $\overline{\mathfrak{b}}$ of $\mathfrak{b}$ in $Cl(K)$ are the same. Now since $Cl(K)$ is finite, we can choose $n\in\mathbb{N}$ such that $\mathfrak{b}^{n+1}$ is principal, say $\mathfrak{b}^{n+1}=(g^\prime)$ (note that $g^\prime\not\equiv0\text{ mod }\mathfrak{p}$. Hence, as $\overline{\mathfrak{a}}=\overline{\mathfrak{b}}$, also $\mathfrak{a}\mathfrak{b}^n$ is principal, say $\mathfrak{a}\mathfrak{b}^n=(\tilde f)$. Now we calculate
\begin{equation}
(x)=\mathfrak{a}\mathfrak{b}^{-1}=(\mathfrak{a}\mathfrak{b}^n(\mathfrak{b}^{n+1})^{-1}=(\tilde f)(g^\prime)^{-1}=(\frac{\tilde f}{g^\prime}).
\end{equation}
However, that means that $x$ and $\frac{\tilde f}{g^\prime}$ can differ only by a unit, say $\varepsilon$, so setting $f^\prime=\varepsilon\tilde f$ completes the proof.
I hope the answer is not too long for such a short problem; however, it helped me a lot in understanding the class group (what is actually not at all what I wanted but still...).
