For which fields $k$ does the following hold for all $n \geq 1$? Let $(a_1,\ldots,a_n) \in k^n$. Then there exists a polynomial $f(x_1,\ldots,x_n) \in k[x_1,\ldots,x_n]$ such that $f(a_1,\ldots,a_n) = 0$ but $f(b_1,\ldots,b_n) \neq 0$ for all $(b_1,\ldots,b_n) \neq (a_1,\ldots,a_n)$?

This is clearly impossible for $k$ algebraically closed.

It does hold for $k$ a subfield of $\mathbb{R}$; indeed, in that case we can take

$$f(x_1,\ldots,x_n) = (x_1-a_1)^2 + (x_2-a_2)^2 + \cdots + (x_n-a_n)^2.$$