"Counter"-example for Gauss's Lemma on irreducible polynomials Gauss's Lemma on irred. polynomial says,
Let R be a UFD and F its field of fractions. If a polynomial f(x) in R[x] is reducible in F[x], then it is reducible in R[x]. 
In particular, an integral coefficient polynomial is irreducible in Z iff it is irreducible in Q. For me this tells me something on how the horizontal divisors in the fibration from the arithmetic plane SpecZ[x] to SpecZ intersects the generic fiber: a prime divisor (the divisor defined by the prime ideal (f(x)) in Z[x]) intersect the generic fiber exactly at one point (i.e. the prime ideal (f(x)) in Q[x]) with multiplicity one.
Now here is my question:
Give a ring R, with Frac(R)=F, and a polynomial f(x) in R[x] such that f(x) is reducible in F[x], but is irreducible in R[x]. 
Of course, R should not be a UFD.
I'd like to see an example for number fields as well as a geometric example (where R is the affine coordinate ring of an open curve or higher dimensional stuff). Thanks
 A: For any commutative ring $B$ and subring $A$, the following are equivalent:
(1) $A$ is integrally closed in $B$
(2) If $F\in A[X]$ factorizes as $F = GH$ in $B[X]$ with $G$ and $H$ monic, then $G$ and $H$ are in $A[X]$.
These conditions imply:
(3) If $F\in A[X]$ is monic and irreducible, then $F$ remains irreducible in $B[X]$.
When $B$ is an integral domain, all three conditions are equivalent.
Proof: (2) $\Rightarrow$ (1) is trivial: if $F(b)=0$ for some $b\in B$ and $F\in A[X]$ monic, then $F = (X-b)G$ in $B[X]$ for some polynomial $G$ (remainder theorem). Then $G$ is monic, so by (2) $X-b$ and $G$ are in $A[X]$. In particular, $b$ is in $A$.
(1) $\Rightarrow$ (2) is folklore. Take a commutative ring $S$ that contains $B$, over which $G$ and $H$ can be written as products of linear factors: $G = (X-x_1)\cdots(X-x_n)$, $H = (X-y_1)\cdots(X-y_m)$. Then in $S$ the $x_i$ and $y_j$ are zeroes of the monic polynomial $F$, so they are integral over $A$. But the coefficients of $G$ and $H$ are (elementary symmetric) polynomials in the $x_i$ and $y_j$, respectively, hence they are again integral over $A$. As these coefficients are in $B$, by (1) they must lie in $A$. (Basically, one can construct such a ring $S$ in the same way as a splitting field for a polynomial over a field is found: first consider $S_1:= B[X]/(G)$; then $G = (X-x_1)G_1$ in $S_1[X]$, where we write $x_1 := X \bmod (G)$ in $S_1$. Then "adjoin another root $x_2$ of $G$" by passing to $S_2 := S_1[X]/(G_1)$, etc, until we arrive at a ring $S_n$ over which $G$ completely splits into linear factors. Then proceed to adjoin roots for $H$ in the same manner. Note that $B$ remains a subring throughout, i.e. no non-zero element of $B$ will map to $0$ in $S$.)
Condition (3) immediately follows from (2), for if $F = GH$ in $B[X]$, the leading coefficients of $G$ and $H$ are inverse units of $B$ because $F$ is monic. So we can rewrite this as $F = G_1H_1$ with $G_1$ and $H_1$ monic in $B[X]$.
When $A$ and $B$ are domains, (3) implies (1): if $F(b) = 0$ with $b\in B$ and $F\in A[X]$ monic, factor $F$ as $F_1\cdots F_r$ with the $F_i$ monic and irreducible in $A[X]$. (Factoring $F$ as a product of monic polynomials reduces the degree, so eventually we wind up with factors that are irreducible.) Since $B$ is a domain, it follows that $F_i(b) = 0$ for some $i$. By (3), $F_i$ is still irreducible in $B[X]$. But it is divisible by $X-b$ there, and so $F_i = X-b$. Hence $X-b$ is in $A[X]$ and thus $b$ belongs to $A$.
Q.e.d.
(Matthe van der Lee, Amsterdam.)
A: Gauss' Lemma over a domain R is usually taken to be a stronger statement, as follows:
If R is a domain with fraction field F, a polynomial f in R[T] is said to be primitive if the ideal generated by its coefficients is not contained in any proper principal ideal.  One says that Gauss' Lemma holds in R if the product of two primitive polynomials is primitive.  (This implies that a polynomial which is irreducible over R[T] remains irreducible over F[T].)  Say that a domain is a GL-domain if Gauss' Lemma holds.
It is known that this property is intermediate between being a GCD-domain and having irreducible elements be prime (which I call a EL-domain; this is not standard).  Here is a relevant MathSciNet review:

MR0371887 (51 #8104)
Arnold, Jimmy T.; Sheldon, Philip B.
Integral domains that satisfy Gauss's lemma.
Michigan Math. J. 22 (1975), 39--51.
Let $D$ be an integral domain with identity. For a polynomial $f(x)\in D[X]$, the content of $f(X)$, denoted by $A_f$, is the ideal of $D$ generated by the coefficients of $f(X)$. The polynomial $f(x)$ is primitive if no nonunit of $D$ divides each coefficient of $f(X)$ (or equivalently, if $D$ is the $v$-ideal associated with $A_f$). On the other hand, $f(X)$ is superprimitive if $A_f{}^{-1}=D$. The authors study, among other things, the relation between the following four properties on an integral domain: (1) each pair of elements has a greatest common divisor; (2) each primitive polynomial is superprimitive; (3) the product of two primitive polynomials is primitive; (4) each irreducible element is prime. In an integral domain $D$, the implications (1) $\Rightarrow$ (2) $\Rightarrow$ (3) $\Rightarrow$ (4) hold, while no reverse implication holds in general. On the other hand, the properties (2), (3) and (4) are equivalent in $D[X]$.

On the other hand, when R is Noetherian, all of these conditions are equivalent, and equivalent to being a UFD: see, e.g., Theorem 17 of
http://alpha.math.uga.edu/~pete/factorization.pdf
Thus a Noetherian domain satisfies Gauss' Lemma iff it is a UFD.  In particular, such rings must be integrally closed, but this condition is not sufficient: e.g. take the ring of integers of any number field which is not of class number one (for instance Z[\sqrt{-6}]).
A: For number fields take $R = \mathbb{Z}[ \sqrt{-3} ]$ and $f(t) = t^2 + t + 1$.  This polynomial is irreducible over $R[t]$ because the only units of $R$ are $\pm 1$, but $f(t) = \left( t - \frac{-1 + \sqrt{-3}}{2} \right) \left( t - \frac{-1 - \sqrt{-3}}{2} \right)$.
For function fields take $R = \mathbb{C}[x, y]/(x^2 - y^3)$ and $f(t) = t^2 - y$.  This polynomial is irreducible over $R[t]$ because $y$ is not a square, but $f(t) = \left( t - \frac{x}{y} \right) \left( t + \frac{x}{y} \right)$.
Gauss's lemma fails for any ring $R$ which is not integrally closed, which is how the above examples are constructed.  In the latter case this is because of the singularity at $(0, 0)$ (and in general this means some localization isn't integrally closed).  Taking the integral closure resolves singularities for Krull dimension 1 (both of the above examples), although presumably you already knew this.
A: This is basically a fleshing out of Pete's answer.
Using the formulation of Gauss's lemma in terms of primitive polynomials, in $\mathbb{Z}[\sqrt{-5}]$, the polynomial $2x+(1+\sqrt{-5})$ is primitive, but
$$(2x+1+\sqrt{-5})^2 = 4x^2 + 4(1+\sqrt{-5}) x + (-4+2 \sqrt{-5})$$
is divisible by $2$.
Another example, again using the formulation in terms of primitive polynomials:
if $R = k[a,b,c,d]/(ad-bc)$ then $(ax+b)$ and $(ax+c)$ are primitive but
$$(ax+b)(ax+c) = a (x^2 + (b+c)x + d).$$
In general, if $p$ is irreducible, $p|ab$ but $p$ does not divide $a$ or $b$, then $px+a$ and $px+b$ are primitive but $(px+a)(px+b)$ is divisible by $p$. So Gauss's lemma implies that, if $p$ is irreducible and $p|ab$ then $p|a$ or $p|b$. Pete calls this property EL and shows that, in a Noetherian domain, EL is equivalent to UFD.
I agree with Qiaochu that the formulation of Gauss's lemma which you give should be equivalent to the ring being integrally closed, at least for noetherian rings.
