Gauss's lemma is the key that you need.
Let R be a Unique factorization domain with field of fractions F and let if p(x) is reducible in F[x] then p(x) is reducible in R[x].
What you actually want is the contraposative.
if p(x) is irreducible in R[x] then it is irreducable in F[x]
So in your case R is the integers and F is the rationals.
You should be able to finish from here