Then since Bezout's identity holds and the binary operator gcd is associative, $g\in I$.
Also any element of $I$ is divisible by $g$. Thus $I=<g>$ and hence $D$ is PID
I have two questions, is the proof correct? and Where did I use the fact that $D$ is UFD? I think $D$ being Integral Domain with identity is enough as well.