Ring where irreducibles are primes which is not an UFD

In the ring of all algebraic integers, there are no irreducibles (since, for example, if $a$ is an algebraic integer, so is $\sqrt a$, and $a=\sqrt a\sqrt a$), so every irreducible is (vacuously) prime. You cannot decompose any element into a finite product of irreducibles since, as noted, there aren't any irreducibles.


How about $\mathbb C[X_1, X_2, \ldots]/(X_k-X_{k+1}^2\mid k\in\mathbb N)$? The only ireducible elements are the constants: Every polynomial in several variables $X_1,\ldots,X_n$ can be rewritten as one in $X_n$ only. Unless it is constant, we can even write it as a polynomial of degree $\ge 2$ in $X_{n+1}$ and this has a nontrivial linear factor $X_{n+1}-\alpha$. Since the product of constants is constant, not every element can be written as product of irreducibles.