Theorem 179 in the book Commutative Rings by Kaplansky states that:
Let $R$ be an integral domain. The following conditions are necessary and sufficient for $R$ to be a UFD.
(1) $R$ satisfies the ascending condition on principal ideals
(2) In the polynomial ring $R[x]$ all minimal prime ideals are finitely generated.
(3) For any prime ideal $P$ of grade one in $R$, $R_P$ is a UFD.
(4) In any localization of $R[x]$ all invertible ideals are principal.
Now, I want to put this theorem in practice that is I'm looking for Noetherian domain $R$ , such that every localization $R_P$ at prime ideal $P$ is UFD but $R$ is not UFD.
As $R$ is Noetherian domain so the condition (1), (2) hold immediately.
If dim$R=1$ and because grade cannot exceeds dimension so every non zero prime ideal $P$ in $R$ has grade one then ht$P$=G$(P)$=1.
Now if $R$ is integrally closed then $R_P$ is DVR hence UFD then (3) holds.
At this point, I'm stuck because I have no idea to use condition (4).
I'm looking for concrete example such that (4) fails.
Thank in advance.