If x is an irreducible and x divides a*b. If x|a then proof is complete, otherwise the only common factors are units and so (a,x) = R (ideal generated by a and x). Thus, (ab,bx) = (b). Now argue that (b) is a subset of (x) and so x divides b.
Why is every irreducible element in UFD a prime element?
x is irreducible means if x =ab, then either a or b is unit.
x is prime means if x =ab, x|a or x|b.
Now, let x be irreducible, let x=ab, WLOG let a be a unit.
Since x is in UFD, let where each u is irreducible.