The proof of Bézout's identity does not require prime factorization. A consequence of this theorem is Gauss' lemma, which is the following generalization of Euclid's lemma:
If $a,b,c$ are three integers such that $a | bc$ and $a$ is prime to $b$, then $a|c$.
Indeed, given the situation of the lemma, by Bézout's identity there exists some integers $u,v$ such that $au + bv = 1$. Multiply this identity by $c$ to deduce that $c = auc + bcv$. Now, $a$ divides $auc$ and $bcv$, so that $a$ divides their sum, that is $c$.
So far, nowhere did we use prime factorization.
Now, the proof just goes as written in the first answer. Assume towards a contradiction that $n$ is prime. If $n$ is prime to $a$ then $n$ divides $b$ by Gauss' lemma. The identity
$$c = \left(\frac{b}{n}\right)a$$
then contradicts the fact that $c < a$.
Otherwise, $n$ is not prime to $a$. It means that there exists a common divisor $d>1$ to both $n$ and $a$. Since $n$ is prime, we must have $d=n$. Thus, $n$ divides $a$. The identity
$$c = \left(\frac{a}{n}\right)b$$
then contradicts the fact that $c < b$.