I'm working from the definition that in an integral domain $R$, an irreducible is an element $p$ such that if $p=xy$ then either $x$ or $y$ is a unit. In certain proofs on my course, the lecturer has used that if $p$ is irreducible, then if $p|xy$ then either $x$ or $y$ is a unit. I'm struggling to see how this follows from my definition.
What I've got so far:
If $p|xy$ then $p=rxy=r(xy)=(rx)y$ for some $r\in R$. Then either $rx$ is a unit or $y$ is a unit. If $y$ is a unit then we're done. If not, then $rx$ is a unit, so there exists an element $h$ say, such that $h(rx)=(rx)h=1$. Then $x$'s inverse is $rh$, so $x$ is a unit. To be honest I've made progress with the solution in the act of writing the post, so the aim of my post has changed from asking how to prove it to checking if the argument is sound. Thanks for any help.
the way you write it it is not correct, because you could choose $x=y=p$, with $p$ irreducible and not a unit. then you would have counterexample
As far as i know there is a definition for "prime" in integral domains: $p \mbox{ is prime } :\Leftrightarrow \forall x,y \in R : p|xy \Rightarrow p|x \mbox{ or } p|y$. "prime" and "irreducible" are equivalent ind factorial rings, but i think not in every integral domain.
At the beginning of your proof you made a mistake: if $p|xy$ it doesnt mean that $p=xyr$, it does mean that $pr=xy$ for some $r$