Let $\varphi\colon\mathbb{Z}[x_1,\dots,x_n]\to\mathbb{Q}$ be a ring homomorphism. I claim that $\varphi$ is not surjective.
Let $\varphi(x_k)=a_k/b_k$, for $k=1,\dots,n$. Choose a prime $p$ that does not divide $b_k$, for each $k$. Suppose that $\varphi(f)=1/p$. Denote by $\deg_k(f)$ the degree of $f$ as a polynomial in $x_k$ and let
$$
m=\max_k\deg_k(f)
$$
Then we can write
$$
f(a_1/b_1,\dots,a_n/b_n)=\frac{q}{b_1^m\dots b_n^m}
$$
where $q$ is an integer (prove it). Then from $\varphi(f)=1/p$ we derive
$$
pq=b_1^m\dots b_n^m
$$
which is a contradiction.