It feels like this should be a well-known question, but I can't find any related questions on this site by searching; apologies in advance if this is a duplicate.
I assume rings are commutative with multiplicative identity. Most examples of non-UFDs involve cases where factorization is not unique, e.g. $\mathbb Z[\sqrt{-5}]$ is not an UFD because $$ 2 \cdot 3 = 6 = (1+\sqrt{-5}) \cdot (1-\sqrt{-5}) $$ and none of the divisors are associate. Is there an integral domain $R$ where:
- Factorization is unique in the sense that if $p_1p_2\cdots p_n = q_1q_2\cdots q_m$ where $p_i$ and $q_i$ are irreducible elements in $R$, then $m=n$ and we can reorder such that $p_i$ is an associate of $q_i$ for each $i=1,2,\dots, n$.
- Factorization may not exist: there is some non-unit $x$ that cannot be written as the product of irreducible elements.
Let $k = {\Bbb F}_2$ and let $M$ be the multiplicative monoid defined on $\{ x \in \Bbb R \mid x \geqslant 1\}$. I claim that the monoid ring $k[M]$ contains no irreducible elements. The elements of $k[M]$ can be written as formal sums
$$ \sum_{m \in M} c_m m \quad \text{where $c_m \in k$ and $c_m = 0$ for almost all $m \in M$} $$ First, $1$ is the unique unit of $R$. Next, since we are in characteristic $2$ and each $c_m$ is idempotent, one has $$ \sum_{m \in M} c_m m = \Bigl(\sum_{m \in M} c_m\sqrt{m} \Bigr)^2 $$ and thus no $\sum_{m \in M} c_m m$ is irreducible.
Since there is no irreducible element, $1$ is the unique element to have a factorization, namely the trivial, but also unique, factorisation $ 1 = \prod_{i \in \emptyset} x_i $. Thus $k[M]$ answers your question.