Real polynomial in two variables I have problems proving the following result:

Each $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ such that $\forall a,b \in \mathbb{R} \ : \ f_a(y) := f(a,y), \ f_b(x) := f(x,b) $ are polynomials is a polynomial with two variables.

If I consider $f$ as a function of $x$, then its derivative  $f'(x) = \frac{\partial f}{\partial b}(x)$. Similarly if we treat $f$ as a function of $y$. 
I assume that $f_a(y) = \frac{\partial f}{\partial a} (y) $ and $f_b(x)=\frac{\partial f}{\partial b}(x)$.
But I am not sure if we can assume that, because  the degree of the derivative should be smaller than the degree of the original function (and it isn't). 
Actually, I'm not even sure if what I'm trying to prove is true, because in the original formulation of the problems there is written $f_a(y) := (a,y), \ f_b(x):=(x,b)$. But that didn't make sense.
Could you help me here?
Thank you.

Set $f(\cdot, y):x\mapsto f(x,y)$. Since this $f(\cdot, y)$ is $x$-continuous, when $y_n\to y$ the polynomials $f(\cdot, y_n)$ converge pointwise everywhere. Hence, for fixed $N$, the sets 
$\{y| \deg f(\cdot, y)\leq N \}$ are closed. By Baire there exist $N$ and $Y\subset \Bbb R$ open, such that $\deg f(\cdot, y)\leq N, \forall y\in Y$. Interchanging $x$ and $y$ we have $M$ and $X\subset \Bbb R$ with analogous properties. Fix arbitrarely $x_0<\dots <x_N$ in $X$, $y_0<\dots <y_N$ in $Y$ and take the polynomial $g$ of bi-degree $(N,M)$ which equals $f$ at the $(N+1)(M+1)$ points $(x_j,y_k)$. If $h=f-g\equiv 0$ we are done. For any $y\in Y$, $h(\cdot, y)$ vanishes identically because its degree is $\leq N$ and it vanishes at $x_0,\dots , x_N$. Thus, $\forall x\in\Bbb R$ $h(x,\cdot)$ vanishes identically because it vanishes in the open set $Y$. This means $h\equiv 0$.   
