In the middle of a homework problem I realized I proved this lemma: an irreducible polynomial $q \in \mathbb{Z}[x]$ with $\deg q > 1$ has no rational roots. This seems... odd, since many well-known theorems on irreducibility and existence of roots for polynomials with integer coefficients (like the rational root theorem and Eisenstein's criterion) do not go this far. What went wrong in this proof? Or otherwise, am I missing a super easy corollary of the definition of an irreducible polynomial that makes the lemma trivial? Any hints are appreciated.
Here is the proof:
Assume $\beta$ is a root of $q$. Since $\mathbb{Z}[x]$ is a PID we have that $I = (q)$ is a maximal ideal of $\mathbb{Z}[x]$ and so $K = \mathbb{Z}[x]/I$ is a field. Define $f: K \to \mathbb{Q}$ by $f(r + I) = r(\beta)$; this map is well defined because if $r + I = s + I$ then $r - s \in I = (p)$, so $r(x) - s(x) = t(x) p(x)$ for some $t \in \mathbb{Z}[x]$ and thus $r(\beta) = s(\beta) + t(\beta) p(\beta) = s(\beta)$. This map is also a field homomorphism since $(r + s)(\beta) = r(\beta) + s(\beta)$ and $(rs)(\beta) = r(\beta) s(\beta)$. Being a homomorphism between fields, $f$ is injective. If $r(\beta) = 0$ then $r + I \in \ker f = \{I\}$ and so $r \in I = (q)$; this means, in particular, that $\deg r \geq \deg q > 1$ (I'm adopting the convention that $\deg 0 = \infty$), so any polynomial in $\mathbb{Z}[x]$ with $\beta$ as a root has degree greater than $1$. But if $\beta = a/b \in \mathbb{Q}$ then the polynomial $r(x) = bx - a \in \mathbb{Z}[x]$ has $r(\beta) = 0$ and $\deg r = 1$, a contradiction. Hence $\beta \notin \mathbb{Q}$ and so $q$ has no rational roots.