If $R$ is not a UFD then $RS^{-1}$ is not a field considering the set in $(*)$. Is this proof I did correct?
Proof: Let $R$ integral domain, $P$ the set of all non-zero prime elements of $R$ and let $$S:= \{1\}\cup\{a_1a_2\cdots a_n:a_i \in P, i=1,\dotsc ,n, n \geq 1\} \quad (*)$$ Suppose that $R$ is not a UFD. Then there exists a nonzero, noninvertible element $a \in R$ such that $a$ cannot be expressed as a finite product of primes, this implies that $a \notin S$.
Let $x \in (a)$ then for some $n \geq 1$ and $a_k,a_k'\in R$ with $k = 1,\dotsc,n$ , we have $$x = \sum_{k=1}^na_kaa_k' = a\sum_{k=1}^na_ka_k' = aw$$ where $w = \sum_{k=1}^na_ka_k'$. Let us note that $x \neq 1$ since $a$ is not invertible. Moreover, since $a$ cannot be expressed as a finite product of primes, $x$ cannot be expressed as a finite product of primes either regardless of whether $w$ can be expressed as a finite product of primes or not and hence $x \notin S$ and so $(a)\cap S = \emptyset$. Since $(a)\cap S = \emptyset$ and $a \neq 0$, then $(\frac{a}{1})$ is a nonzero proper ideal of $RS^{-1}$ and this proves $RS^{-1}$ is not a body since there exists a nontrivial ideal. $\blacksquare$