TITLE: Every affine variety in the real affine space $A^n_R$ is the zero locus of one polynomial.
QUESTION [5 upvotes]: Sorry if this is a stupid question to ask. This is an exercise from Gathmann's Algebraic Geometry. 
Show that every affine variety in the real affine space $A^n_R$ is the zero locus of one polynomial.
If some context might help, he is talking about dimension of a topological spaces in that section. In the same problem, he asks to show that every Noetherian topological space is compact, which is easier to show. 
I have no idea where to start. Please give me some hint. Thank you so much!

REPLY [6 votes]: By definition (I assume this is your book's definition-- I don't really like using the language of classical algebraic geometry when I am working over $\mathbb{R}$), the variety is the vanishing locus of $m$ polynomials $f_1, \ldots, f_m$. So we need to construct ONE polynomial that vanishes if and only if all $m$ of those polynomials vanish. This we can do using a trick:
$$
g(x_1, \ldots, x_n) = f_1(x)^2 + \ldots f_m(x)^2
$$
This clearly vanishes if all the $f_i$ vanish; if they don't all vanish, it's clearly positive and in particular not zero.