Can you find a domain where $ax+by=1$ has a solution for all $a$ and $b$ relatively prime, but which is not a PID? In Intro Number Theory a key lemma is that if $a$ and $b$ are relatively prime integers, then there exist integers $x$ and $y$ such that $ax+by=1$.  In a more advanced course instead you would use the theorem that the integers are a PID, i.e. that all ideals are principal.  Then the old lemma can be used to prove that "any ideal generated by two elements is actually principal."  Induction then says that any finitely generated ideal is principal.  But, what if all finitely generated ideals are principal but there are some ideals that aren't finitely generated?  Can that happen?
 A: See the Wikipedia article Bézout domain.
A: How about this construction:
Define a domain $R_0$ as follows. Take a field $K$, adjoin an indeterminate $x_0$, and localize at $(x_0)$ (that is, adjoin inverses to everything not a multiple of $x_0$).
$R_0$ has all its ideals principal and linearly ordered: $(x_0)$ contains $(x_0^2)$ contains $(x_0^3)$...
Now given $R_i$, define $R_{i+1}$ inductively: Adjoin an indeterminate $x_{i+1}$, so we have $R_i[x_{i+1}]$. Quotient by $(x_{i+1}^2 - x_i)$. Finally, localize at the prime ideal $(x_{i+1})$.  
This effectively just gives us one more principal ideal containing all the principal ideals from $R_i : (x_{i+1})$ contains $(x_{i+1}^2)=(x_i)$ contains $(x_i^2)$... 
Now let $R$ be the union of all the $R_i$, and it's obvious that any finitely generated ideal is principal, but there's a non-fg one generated by all the $x_i$. 
A: The easiest example I know is the ring of all algebraic integers (roots of monic polynomials with integer coefficients). As noted, it is a Bezout domain, so every finitely generated ideal is principal, and in particular for every two algebraic integers $a$ and $b$ there exist algebraic integers $\alpha$ and $\beta$ such that $\alpha a+\beta b = d$, where $d$ is a gcd for $a$ and $b$. However, the ideal $(2, 2^{1/2}, 2^{1/4}, 2^{1/8}, \ldots, 2^{1/2^{n}},\ldots)$ is not principal, so the ring is not a PID.
A: Note: for more on Bézout domains, see e.g.

Section 8.2 of http://alpha.math.uga.edu/~pete/factorization2010.pdf

or

Section 12.4 of http://alpha.math.uga.edu/~pete/integral.pdf

A: I found this 6-year old question when I was searching about Bézout domains and I think I can say something about the question. Well, more exactly I think the work of P. M. Cohn in his paper "Bézout rings and their subrings" deserves to be exposed. 
First, let me give some terminology. Given an integral domain $R$, we say that $a,b\in R$ are coprime if $\gcd(a,b)$ exists and $\gcd(a,b)=1$. On the other hand, we say that $a$ and $b$ are comaximal if there are $x,y\in R$ such that $ax+by=1$. 
It's easy to see that comaximal $\implies$ coprime, but the other implication isn't necessarily true. Domains where coprime $\implies$ comaximal were called by Cohn Pre-Bézout domains. As the names suggest, these aren't necessarily Bézout domains, because we only have the "Bézout relationship" for coprime elements. But, it turns out that we can use Pre-Bézout domains to characterize Bézout domains among the class of GCD domains. More exactly, it's true the following:
Theorem: Let $R$ be an integral domain. TFAE:
i) $R$ is a Bézout domain.
ii) $R$ is a GCD Pre-Bézout domain.
Proof: i)$\implies$ii) It's immediate.
ii)$\implies$i) Let $a,b\in R$. WLOG, we can suppose that $a\neq 0\neq b$. As $R$ is a GCD domain, then $d=\gcd(a,b)$ exists. By an elementary property of gcds we have that $1=\gcd(a/d,b/d)$ and since $R$ is Pre-Bézout then $a/d$ y $b/d$ are comaximal, which means that there are $x,y\in R$ such that $$\frac{a}{d}x+\frac{b}{d}y=1.$$ Finally, if we multiply by $d$ the above equality we get $$ax+by=d.$$
Thus $d$ is a $R$-linear combination of $a$ and $b$. Hence, $R$ is Bézout domain.
In conclusion, according to Cohn, the class of domains you are looking for are known as Pre-Bézout domains, and these aren't necessarily Bézout domains, let alone PIDs.
A: If I'm not mistaken, the integral domain of holomorphic functions on a connected open set $U 
\subset \mathbb{C}$ works. It is a theorem (in Chapter 15 of Rudin's Real and Complex Analysis, and essentially a corollary of the Weierstrass factorization theorem), that every finitely generated ideal in this domain is principal. This implies that if $a,b$ have no common factor, they generate the unit ideal.  However, for instance, the ideal of holomorphic functions in the unit disk that vanish on all but finitely many of ${1-\frac{1}{n}}$ is nonprincipal.
