Can the zero set of a nonzero polynomial by the whole affine space? I am just beginning to study algebraic geometry and I want to ask how can we show that (given a algebraically closed field), the zero set of a multi variable polynomial cannot be the entire affine n space unless it is the zero polynomial itself . Of course this seems completely obvious , but as usual with algebraic stuff , I’m not if the proof is suppose to be trivial or difficult .
 A: This can be done without the Nullstellensatz, more or less from first principles. I'll give two proofs. The proofs require only that the underlying field $k$ is infinite; it's not necessary to assume that it's algebraically closed.
Proof 1, finite differences: This one only works in characteristic zero. Suppose $f(x_1, \dots x_n)$ is a polynomial vanishing on $k^n$, $k$ an infinite field. Then the same is true for the finite difference
$$\Delta_{x_i} f = f(x_1, \dots x_i + 1, \dots x_n) - f(x_1, \dots x_i, \dots x_n)$$
in any of the variables $x_i$. But taking the finite difference in $x_i$ has the effect of reducing by exactly $1$ the degree of any monomial in which $x_i$ appears (this is false in positive characteristic since, for example, $\Delta_x x^p = 1$, so here is where we need to assume characteristic zero). By repeatedly taking finite differences we can remove every monomial in $f$ except the leading one (with respect to any monomial order, it doesn't matter which), which we can reduce to a constant. Since this constant polynomial inherits from $f$ the property that it vanishes on $k^n$, it must be identically zero. But this is only possible if $f$ had no leading term, meaning it is identically zero. $\Box$
(This argument doesn't really use that we're working over a field; we only need to be working over a commutative ring in which the elements of $\mathbb{Z}$ are not zero divisors, so e.g. this argument applies to $\mathbb{Z}$.)
Proof 2, induction on the number of variables: This argument will prove the following stronger result which Sassatelli Giulio gives in the comments: if $f(x_1, \dots x_n)$ vanishes on a set of the form $S_1 \times \dots \times S_n$ where each $S_i$ is infinite, then $f$ is identically zero. This is maybe the "standard" argument.
The proof is by induction on $n$. This is clear when $n = 1$. If $f(x_1, \dots x_n)$ is a polynomial in $n$ variables vanishing on $S_1 \times S_n$, then by hypothesis, if we select $r_i \in S_i$ then $f(x_1, r_2, \dots r_n)$ is a polynomial in $k[x_1]$ which vanishes on $S_1$ and hence (by the $n = 1$ case) which is identically zero. As a polynomial in $x_1$ with coefficients in $k[x_2, \dots x_n]$ (or if you prefer, in $k(x_2, \dots x_n)$) it follows that every coefficient in $k[x_2, \dots x_n]$ vanishes on $S_2 \times \dots \times S_n$. By the inductive hypothesis every coefficient vanishes identically, so $f$ vanishes identically. $\Box$
(With a little effort one can write down explicit bounds on the size that each $S_i$ needs to be for this argument to work - they don't actually need to be infinite, they just need to be sufficiently large - and this gives what is called the combinatorial Nullstellensatz.)
A: Edited to provide more detail:
Suppose a polynomial $f$ has $\mathbb{A}^n$ as its zero set. Since we're assuming we're working over an algebraically closed field, we can appeal to the Nullstellensatz. More specifically, we can use the fact (which is a direct consequence of the Nullstellensatz) that for $\frak a$ an ideal of $k[x, y]$, $I(Z(\frak a)) = \sqrt{\frak a}$, where $\sqrt{\frak a}$ denotes the radical of $\frak a$.
Using this result, together with our assumption that $Z((f)) = \mathbb{A}^n$, we have that $\sqrt{(f)} = I(Z((f))) = I(\mathbb{A}^n) = I(Z(0)) = \sqrt{(0)}.$ Since $k[x, y]$ is an integral domain, $(0)$ is prime, hence $\sqrt{(0)} = 0$. Since an ideal is always contained in its radical, it follows that $(f) = 0$. Again, since $k[x, y]$ is an integral domain, we must have $f = 0$.
