What are examples of irreducible but not prime elements?
I am looking for a ring element which is irreducible but not prime.
So necessarily the ring can't be a PID. My idea was to consider $R=K[x,y]$ and $x+y\in R$.
This is irreducible because in any product $x+y=fg$ only one factor, say f, can have a $x$ in it (otherwise we get $x^2$ in the product). And actually then there can be no $y$ in $g$ either because $x+y$ has no mixed terms. Thus $g$ is just an element from $K$, i.e. a unit.
I got stuck at proving that $x+y$ is not prime. First off, is this even true? If so, how can I see it?
Let $\rm\ R = \mathbb Q + x\:\mathbb R[x],\ $ i.e. the ring of real polynomials having rational constant coefficient. Then $\,x\,$ is irreducible but not prime, since $\,x\mid (\sqrt 2 x)^2\,$ but $\,x\nmid \sqrt 2 x,\,$ by $\sqrt 2\not\in \Bbb Q$
This is impossible: any polynomial ring over a field is a U.F.D. In such domains, irreducible elements are prime.
The simplest example is the ring of quadratic integers $\;\mathbf Z[i\sqrt 5]$, which is not a U.F.D.. In this ring, we have $$2 \cdot 3=(1+i\sqrt 5)(1-i\sqrt 5),$$ so that $2$ divides the product $\;(1+i\sqrt 5)(1-i\sqrt 5)$, but doesn't divide any of the factors, since it would imply the norm $N(2)=4$ divides $N(1\pm i\sqrt 5)=6$. $2\;$ is irreducible for similar reasons: if $ a+ib\sqrt 5$ is a strict divisor of $2$ and a non-unit, its norm $a^2+5b^2$ is a non-trivial divisor of $4$, i.e. $\;a^2+5b^2=2$. Unfortunately, this diophantine equation has no solution.
Thus, $2$ is a non-prime irreducible element. The same is true for all elements in these factorisations of $6$.
Another example, with polynomial rings:
Consider the ring of polynomial functions on the cusp cubic $$R=\mathbf C[X,Y]/(X^2-Y^3).$$ This is an integral domain, as the curve is irreducible. Actually, we have a homomorphism: \begin{align*} \mathbf C[X,Y]&\longrightarrow\mathbf C[T^2,T^3]\\ X&\longmapsto T^3,\\ Y&\longmapsto T^2. \end{align*} This homomorphism is surjective, and its kernel is the ideal $(X^2-Y^3)$, so that it induces an isomorphism $R\simeq \mathbf C[T^2,T^3]$.
If we denote $x$ and $y$ the congruence classes of $X$ and $Y$ respectively, we have $x^2=y^3$. The element $y$ is irreducible, for degree reasons, but it is not prime, since it divides $x^2$ but doesn't divide $x$.