A lemma states:
Let $R$ be a UFD and $F=\operatorname{Frac}(R)$. Let $d\in R$, then equation $a^2=d$ has a root in $R$ iff it has a root in $F$.
So I want to ask, is there a counterexample for this if $R$ is not a UFD? I only know some non-UFD integral domains like ring of integers for some values.
Let $k$ be a field and $R=k[x^2,x^3]$, the subring of $k[x]$ consisting of polynomials with no linear term. Taking $d=x^2$, the equation $a^2=d$ has no root in $R$ since $x\not\in R$. But $x=\frac{x^3}{x^2}$ is an element of the field of fractions $F$, so there does exist a root in $F$.
(To see directly that $R$ is not a UFD, note that $x^2$ and $x^3$ are both irreducible in $R$, but $(x^2)^3=(x^3)^2$, giving two distinct factorizations of $x^6$.)