Polynomial in $n$ variables

Let $f$ be polynomial in $n$ variables. If we have $f(a_1,\ldots,a_n) = 0, a_i \in S_i$ and $S_1,\ldots,S_n$ are infinite subsets of a field $k$, how can I show that $f=0$?


Let $\;g(a_1,...,a_{n-1},x)\in k[x]\;$ . Since this polynomial's degree (in $\,x\,$) is finite yet it has infinite roots (all the elements in $\,S_n\,$), it must be the zero polynomial. But

$$g(a_1,...,a_{n-1},x)=b_0+b_1x+\ldots+b_rx^r\;,\;\;b_i=g_i(a_1,...,a_{n-1})\in k$$

and from here that $\,b_0=b_1=\ldots=b_r=0\;$ .

Now use an inductive argument on each $\,g_i\;$ ...