Show that $X$ is not an affine variety I need some help proving that $X=\{(x,x)~|~x \in \mathbb{R}, x \neq 1\}$ is not an affine variety. I would like to proceed by supposing it is an affine variety and then finding a contradiction. So assume $X=V(f_1,...,f_s)$. Now I want to show that if $f \in \mathbb{R}[x,y]$ vanishes on $X$ then $f$ also vanishes at the point $(1,1)$. 
I have thought about how to proceed form here for about an hour now and have not got anywhere. Please help. Thanks
 A: Here is an alternative to the above answers with a more algebra-y flavor.  (For those interested, this is exercise 1.2.8 of Cox, Little, and O'Shea.)  Given $f(x,y) \in \mathbb{V}(X)$, let $g(t) = f(t,t)$.  Then $g \in \mathbb{R}[t]$ vanishes on $\mathbb{R} \setminus \{1\}$.  But a nonzero polynomial of one variable over a field has only finitely many roots, so we must have $g=0$.  Then $f(1,1) = g(1) = 0$, so $f$ vanishes at $(1,1)$.
A: This actually depends on your viewpoint. For example $Y=\mathbb{R}\setminus \{0\}$ is not an affine subset (i.e. a Zariski-closed subset) of $\mathbb{R}$, but it is an affine variety, when viewed in a different way. We can define a map $V(xy-1)\rightarrow Y$ which is an isomorphism. $V(xy-1)$ of course is a Zariski-closed subset in $\mathbb{R}^2$. 
The point is, there is some nuance to the definition of affine variety. It should be a variety that can be embedded into affine space as a Zariski-closed subset.
Your variety $X$ is obviously isomorphic to $Y$ which I have just mentioned is an affine variety. It is however not an Zariski-closed subset on it's own in $\mathbb{R}^2$ which I am sure is what you wanted. For this you can use the arguments from the other posts. 
I just wanted to mention this detail to let you know there is more to the story.
A: Use the fact that polynomials are continuous functions:
Suppose that $f\in\mathbb R[x,y]$ vanishes on $X$. Then, as $f$ is a continuous function, we have $f(1,1)=\lim_{n\to\infty}f(1+\tfrac1n,1+\tfrac1n)=0$, because $f(1+\tfrac1n,1+\tfrac1n)=0$ for all $n\geq1$.
A: Polynomials are continuous when $\mathbb{R}^2$ is equipped with the Euclidian topology. So assume $f(1,1)\neq 0$ and without loss of generality we could consider it positive. In a neighborhood of $(1,1)$ that contains say $(1+\epsilon,1+\epsilon)$ we have $f(x,x)\neq 0$ which is in contradiction with $f(x,x)=0$ when $x\neq 1$
