Is it true that an integral domain $R$ is a UFD if and only if intersection of any two principal ideals of $R$ is principal ? Is it true that an integral domain $R$ is a UFD if and only if intersection of any two principal ideals of $R$ is principal ?
 A: A ring $R$ such that the intersection of any two principal ideals of $R$ is principal is exactly a GCD domain. And a GCD domain need not be an UFD.
A: No, this is not true. A counterexample is the ring of holomorphic functions $R=Hol(\Bbb{C})$.
$R$ is not a UFD because irreducible (and prime as well) elements of $R$ are functions with exactly one zero with multiplicity 1. However, there are some functions with infinite zeroes (e.g. $\sin z$), and such functions cannot be factorized as a product of finitely many irreducible functions. A theorem by Weierstrass tells us that these functions can be written as an infinite product of irreducible functions. As an example
$$\sin z = \pi z\prod_{k=-\infty, k \neq 0}^{+\infty} \left( 1 - \frac{z}{k} \right)$$
But now, suppose $f,g \in R$. Then $(f)\cap(g)$ is generated by a least common multiple of $f$ and $g$, which can be constructed factoring $f$ and $g$ as a (possibly infinite) product of irreducible functions.
This ring $R$ is not a UFD, but it is almost a UFD. Every element can be written as a (possibly infinite) product of irreducible elements. This can be done because of the topological structure of $\Bbb{C}$. In general, in an algebraic setting you are not allowed to write infinite products.
