Does existence of $\gcd$ implies PID?
Solution 1:
PIDs are precisely the UFDs with dimension $\le 1\,$ (i.e. every prime ideal $\ne 0$ is maximal). Hence any higher dimensional UFD provides a counterexample (because UFDs are always gcd domains), for example $\,\Bbb Z[x],\, \Bbb Q[x,y].\,$ More generally we have
Theorem $\rm\ \ \ TFAE\ $ for a $\rm UFD\ D$
$(1)\ \ $ prime ideals are maximal if nonzero, i.e. $\rm\,dim\ D \le 1$
$(2)\ \ $ prime ideals are principal
$(3)\ \ $ maximal ideals are principal
$(4)\ \ \rm\ gcd(a,b) = 1\, \Rightarrow\, (a,b) = 1\ \ $ i.e. coprime $\Rightarrow$ comaximal
$(5)\ \ $ $\,\rm D$ is Bezout
$(6)\ \ $ $\,\rm D$ is a $\rm PID$
Proof $\ $ (sketch of $1 \Rightarrow 2 \Rightarrow 3 \Rightarrow 4 \Rightarrow 5 \Rightarrow 6 \Rightarrow 1$)
$(1\Rightarrow 2)$ $\rm\ \ \ P\supset (p)\, \Rightarrow\, P = (p)$
$(2\Rightarrow 3)$ $ \: $ Clear.
$(3\Rightarrow 4)$ $\ \ \rm (a,b) \subsetneq P = (p)\ $ so $\rm\ (a,b) = 1$
$(4\Rightarrow 5)$ $\ \ \rm c = \gcd(a,b)\, \Rightarrow\, (a,b) = c\ (a/c,b/c) = (c)$
$(5\Rightarrow 6)$ $\ \ \rm 0 \ne I \subset D$ Bezout is generated by an elt with the least number of prime factors
$(6\Rightarrow 1)$ $\ \ \rm P \supset (p),\ a \not\in (p)\, \Rightarrow\, (a,p) = (1)\, \Rightarrow\, P = (p)$