Let $f$ and $g$ two polynomials with rational coefficients of degree $n$, $n \geq 1$. They share a same root $r$ and $f$ is irreductible. Prove that $f | g$.
I tried writing $f=(x-r)h$ where $h$ is a polynomial of degree $n-1$ but didn’t know what to do next. Please help me with a basic proof.