Units in a ring of fractions 
Let $R$ be a UFD and $D \subseteq R$ multiplicative set.  What are the units in $D^{-1}R$?

I assume the answer should be $D^{-1}R^{\times}$, but I get stuck:
If $a/b$ is a unit, then there exists $c/d$ so that
$$\frac{a}{b} \cdot \frac{c}{d} = \frac{1}{1} \Longleftrightarrow ac = bd,$$
but I don't see what this tells me.  For example, just because $ac \in D$ doesn't seem to imply anything about $a, c$.

It is clear that $\dfrac{1}{1} = \dfrac{d}{d}, d \in D$ is the identity element of $D^{-1}R.$ We want to find the units. Let $u \in R$ is  a unit. So there exists $v \in R$ such that $uv = vu = 1.$ Then obviously, $\dfrac{u}{1} \cdot \dfrac{v}{1} = \dfrac{v}{1} \cdot \dfrac{u}{1} = \dfrac{1}{1},$ showing that $\dfrac{u}{1}$ is a unit in $D^{-1}R.$ Also for each $d \in D, \dfrac{1}{d} \cdot \dfrac{d}{1} = \dfrac{d}{1} \cdot \dfrac{1}{d} = \dfrac{1}{1}.$ So, every element of the form $\dfrac{1}{d}$ and $\dfrac{d}{1}$ where $d \in D$ are units. Now suppose $\dfrac{a}{b}$ is a unit in $D^{-1}R.$ Then there exists $\dfrac{c}{d}$ such that $\dfrac{a}{b} \cdot \dfrac{c}{d} = \dfrac{c}{d} \cdot \dfrac{a}{b} = \dfrac{1}{1}.$ So we have, $ac = bd.$ This shows that both $a$ and $c$ must divide an element of $D.$ On the other hand, suppose $0 \neq a \in R$ be such that $a|d,$ for some $d \in D.$ Let $ab = d.$ Then for any $c \in D, \dfrac{a}{c} \cdot \dfrac{bc^2}{cd} = \dfrac{1}{1},$ proving that $\dfrac{a}{c}$ is a unit in $D^{-1}R.$
If $R$ is a UFD, then we can say more. Every element $d \in D$ is either a unit in $R$ of has a unique prime factorization in $R$ (up to units). Let $S$ be the multiplicative subset of $R$ generated be all the primes that occurs in the prime factorization of elements of $D.$ Then it is easy to show that $D^{-1}R \cong S^{-1}R.$ Form above we see that any element of the form $\dfrac{a}{b}, b \in S$ and $a$ divides some element of $S$ is a unit. This shows that $a \in S.$ So the units of $D^{-1}R$ are precisely of the form $\frac{u}{1}$ where $u$ is a unit in $R$ or of the form $\dfrac{a}{b}$ where both $a, b \in S.$
The last conclusion is not true in general, if we don't assume $R$ is a UFD. Let $R := k[x^2, x^3],$ where $k$ is field, i.e. $R$ is the subring of the polynomial ring $k[x]$ consisting of polynomials whose co-efficient of the degree $1$ term is zero. Then it is not a UFD ($x^6 = (x^2)^3 = (x^3)^2$). Let $D = \{1, x^2, x^4, x^6, \cdots \}.$ Then the element $\dfrac{x^3}{1}$ is a unit in $D^{-1}R: \dfrac{x^3}{1} \cdot \dfrac{x^3}{x^6} = \dfrac{1}{1},$ but $x^3 \notin D.$
