It's perhaps easiest to first note that $\Bbb Q[x,y] \cong (\Bbb Q[y])[x]$. I leave you to puzzle out what this isomorphism has to be. We will use this isomorphism to equate the two rings (we can call this "collecting like terms of $x^k$"). For example, if:
$f(x,y) = a_0 + a_1x + a_2y + a_3x^2 + a_4xy + a_5y^2 + a_6x^3 + a_7x^2y + a_8xy^2 + a_9y^3$, then we have:
$f(x,y) = f_0(y) + f_1(y)x + f_2(y)x^2 + f_3(y)x^3$, where:
$f_0(y) = a_0 + a_2y + a_5y^2 + a_9y^3$
$f_1(y) = a_1 + a_4y + a_8y^2$
$f_2(y) = a_3 + a_7y$
$f_3(y) = a_6$.
Now for any commutative ring $R$ we have for any extension ring $S$ of $R$, and any $a \in S$, a unique homomorphism:
$\phi_a: R[x] \to S$, given by $\phi_a(f(x)) = f(a)$, the so-called "evaluation at $a$ homomorphism". This is, in fact, one of the *defining properties* of a polynomial ring.
Now take $R = \Bbb Q[y]$, and we see that:
$f(x,y) \mapsto f(0,y)$ is just the evaluation homomorphism $\phi_0$. You can also show this is a homomorphism directly, it's not hard (but tedious).
Now if $g \in (x)$, we have $g(x,y) = xr(x,y)$, for some $r \in \Bbb Q[x,y]$.
So, $\phi_0(g) = \phi_0(xr) = 0r(0,y) = 0$, which shows $(x) \subseteq \text{ker }\phi_0$.
On the other hand, suppose $\phi_0(f(x,y)) = 0$.
Since $f(x,y) = f_0(y) + f_1(y)x + \cdots + f_n(y)x^n$
we have $\phi_0(f(x,y)) = f_0(y) + f_1(y)\cdot 0 + \cdots + f_n(y)\cdot 0^n = f_0(y)$.
Since this is $0 \in \Bbb Q[y]$, we have $f_0(y) = 0$, and thus:
$f(x,y) = x(f_1(y) + f_2(y)x + \cdots + f_n(y)x^{n-1}) \in (x)$, so $\text{ker }\phi_0 \subseteq (x)$.
Now do this process TWICE to get two surjective homomorphisms:
$\Bbb Q[x,y] \to \Bbb Q[y] \to \Bbb Q$, whose composition is thus *also* a surjective homomorphism (let's call it $\pi$).
It is easy to show that $(x,y) \subseteq \text{ker }\pi$. A similar argument as above may help you with the other inclusion.