Let $R$ be an integral domain and $p ∈ R$ be such that $p$ is nonzero and a nonunit. Then $p$ is irreducible if and only if the only divisors of $p$ are the associates of $p$ and the unit elements of $R$.
Proof. Suppose the only divisors of p are the associates of $p$ and the unit elements of $R$. Let $p = ab$ for some $a, b ∈ R$. Suppose $a$ is not a unit. Then $a$ is an associate of $p$. Therefore, $a = pu$ for some unit $u ∈ R$. Now $p = pub$. Since $R$ is an integral domain, it follows that $ub = 1$. Hence, $b$ is a unit and so $p$ is irreducible. We leave the converse as an exercise.
this is a theorem from a book and I have tried to proof the converse in the following way:-
suppose $p$ is irreducible and $a|p$. Then there exist $b\in R$ such that $p=ab$ . Since $p$ is irreducible so one of $a$ & $b$ is unit.Let $a$ is unit.Then we need to show that $b$ is associate of $p$. Since $a$ is unit there exist $u \in R$ such that $au=1$. hence $aup=p \implies aup=ab \implies up=b $.So the result follows.
Am I correct?