Claim: $a,b,c \in \mathbb{Z}, $ with $c$ prime. If $c \mid ab$ then $c \mid a$ or $c \mid b.$
My Proposed Proof (Contrapositive): Suppose $c\nmid a, c\nmid b$. So, $a = cd + r$ and $b = ce + q$, with $d,e,q, r \in \mathbb{Z}$. Note $q, r \ne 0 \ne c.$ Next, $ab = c^2ed + cdq + cer + qr = c(ced + dq + er) + qr.$ Since $c$ is prime $qr \ne c$. Therefore $c\nmid ab$.
I am in an intro to proofs class, I just want to know if this proof is valid.