Let $f(x) \in \mathbb{Z}[x]$. Prove that $f(x)$ has a root in $\mathbb{Q}$ iff there is a ring homomorphism from $\mathbb{Z}[x]/(f(x)) \rightarrow \mathbb{Q}$.
I tried using a homomorphism from $\mathbb{Z}[x] \rightarrow \mathbb{Q}$ defined by $\varphi(f(x)) = f(q)$ for a fixed $q \in \mathbb{Q}$. When $q$ is a root this could be useful, but that's all I've managed to come up with, and I'm unclear how to proceed.
The following lemma will be useful.
Lemma. Let $\varphi: A \to B$ be a ring homomorphism and $I$ be an ideal of $A$. Then $\varphi$ descends to a homomorphism $\overline{\varphi}: A/I \to B$ iff $I \subseteq \ker(\varphi)$.
You've defined the map \begin{align*} \varphi: \mathbb{Z}[x] &\to \mathbb{Q}\\ g(x) &\mapsto g(q) \end{align*} Can you see why you can apply the lemma to get a map on the quotient? (As a note, you shouldn't use $f(x)$ to refer to two different things.)