Suppose $f(x_1,\dots,x_n)$ is a polynomial in $n$ indeterminates over an infinite field $F$. Suppose $f((a_i))=0$ for all $n$-tuples $(a_i)$ such that $g((a_i))\neq 0$, where $g(x_1,\dots,x_n)$ is another nonzero polynomial over $F$. I know that the set of $n$-tuples such that $g$ is nonzero is nonempty.
Does this imply $f=0$?
I'm curious, because it's true when $n=1$. Since $g$ has only finitely many roots, the set of values on which $g$ is nonzero is infinite since $F$ is infinite, but then $f=0$ as $f$ has infinitely many roots. Does the same argument work in arbitrarily many indeterminates, or does more care need to be taken? Thanks.