Quotient $K[x,y]/(f)$, $f$ irreducible, which is not UFD

Yes, I think that the standard example is to take $f(x,y)=x^3-y^2$. Then when you look at it this is the same as the set of polynomials in $K[t]$ with no degree-one term. That is, things that look like $c_0+\sum_{i>1}c_it^i$, the sum being finite, of course. You prove this by mapping $K[x,y]$ to $K[t]$ by sending $x$ to $t^2$ and $y$ to $t^3$. I’ll leave it to you to check that the kernel is the ideal generated by $x^3-y^2$, that the image is what I said, and that this is not UFD.


The thing is: a UFD $A$ is always normal, i.e. every element in its field of quotients is integral over $A$ if and only if it belongs to $A$. The above example, $f(x,y)=x^3-y^2$, is one where the corresponding curve is not normal, namely:

$$t=\frac{y}{x}\ \mbox{ satisfies }\ t^3=y,$$ but $t$ itself does not belong to the ring.

A word of caution, though: if $f(x,y)=0$ is smooth, then the corresponding ring is locally factorial, i.e. its local rings at all maximals are factorial, though the global ring itself may not be: it will be Dedekind, no doubt, as $A$ Dedekind is equivalent to $A$ being (Noetherian and) a normal domain of Krull dimension $1$.

The question of global factoriality for rings of hypersurfaces is very difficult to answer, though you will find interesting examples in Hartshorne's Ample Subvarieties book.

MORAL: You need to get used to leaving the concept of global UFD in Algebraic Geometry. A variety being nonsingular at a point does imply that its local ring is factorial, but otherwise this condition is difficult to conceive geometrically.