Let $f \in \mathbb{Z}[x]$ be a non-constant polynomial and let $p$ be a prime number which is not a divisor of the leading coefficient of $f$. I need to prove that if $f$ is irreducible over $\mathbb{Z}_{p}$, then $f$ is irreducible over $\mathbb{Q}$.
I decided to approach this proof by proving the contrapositive: i.e., that $f$ is reducible over $\mathbb{Q}$ $\implies $ $f$ is reducible over $\mathbb{Z}_{p}$.
Now, it is certainly the case that $f$ is irreducible over $\mathbb{Q}$ if and only if it is irreducible over $\mathbb{Z}$. Therefore, if $f$ reducible over $\mathbb{Q}$ implies that $f$ is reducible over $\mathbb{Z}$.
So, the proof therefore reduces to showing that $f$ reducible in $\mathbb{Z} \implies$ $f$ reducible in $\mathbb{Z}_{p}$.
To that effect, suppose $f$ is reducible in $\mathbb{Z}$. Then, $\exists g,h \in \mathbb{Z}[x] $ such that $f(x) = g(x)h(x)$. Now, the fact that $p$ is not a divisor of the leading coefficient of $f$ means that when we reduce $\,f \mod p$ (call this result $\overline{f}$), $f$ and $\overline{f}$ have the same degree.
From this point, I am not sure how to proceed. It seems to make sense to me intuitively that if we reduce $\, f \mod p$, we can reduce $\, g \mod p$ and $\, h \mod p\,$ as well so that we will have shown that $\overline{f}$ is factorable/reducible. But, I'm not sure how to show this in a rigorous way. Could anyone please help me on how I should proceed?
Thank you.