Unique factorisation and the fact that $\mathbb A^2-0$ is not an affine variety? While learning commutative algebra and basic algebraic geometry and trying to understand the structure of results (i.e. what should be proven first and what next) I came to the following question: 
Is it possible to prove that $\mathbb A^2-point$ is not an affine variety, if you don't know that the polynomial ring is a unique factorisation domain?
It seems to me, that this question has some meaning, since when we define affine variety, we don't need to use the fact that the polynomial ring is an UFD. Don't we?
 A: I'd say yes. I'll work over $\mathbb{C}$ to make my life easier. First it is enough to show that the ring of regular functions on $Y:=\mathbb{A}^2(\mathbb{C})−0$ is isomorphic $\mathbb{C}[x,y]$. If Y were affine, the identity map from $\mathbb{C}[x,y]$ to itself would induce an isomorphism between $Y$ and $X:=\mathbb{C}^{2}$ which is impossible.(Polynomial maps are continuous in the usual topology, but $X$ is simply connected and $Y$ is not.)
Now let $Y_{1}:=\mathbb{A}^2(\mathbb{C}) \setminus \{x=0\}$ and $Y_{2}:=\mathbb{A}^2(\mathbb{C}) \setminus \{y=0\}$. Then $\mathcal{O}(Y)=\mathcal{O}(Y_1)\cap \mathcal{O}(Y_2)=\mathbb{C}[x,y]_{(x)} \cap \mathbb{C}[x,y]_{(y)}$.
On the other hand $\mathbb{C}[x,y]_{(x)} \cap \mathbb{C}[x,y]_{(y)}=\mathbb{C}[x,y]$. At first I thought that one needs unique factorization for the last equality, but the only thing one needs is that $\displaystyle (x^{i}y^{j})_{i,j \in \mathbb{N}}$ is a linearly independent subset of $\mathbb{C}[x,y]$. So my point is that $\left( x^{m}y^{n}=x^{p}y^{q} \rightarrow (m,n)=(p,q)\right)$ follows if we know the ring is a UFD, but it also follows trivially from linearly independence.  
A: The abstract reason for this is that $\mathbb A^2$ satisfies Serre's property $(S_2)$ (which follows from being smooth) and hence every regular function is determined in codimension $1$. In other words, the point is that a regular function on $\mathbb A^2\setminus \{0\}$ is a rational function on $\mathbb A^2$ and the locus of indeterminacy of a rational function on $\mathbb A^2$ is of pure codimension $1$ (think of meromorphic functions on $\mathbb C^2$), so if you leave out something of codimension at least $2$, then you cannot get new regular functions. This implies that the natural injection of the ring of regular functions on $\mathbb A^2\setminus \{0\}$ into the ring of regular functions on $\mathbb A^2$ is an isomorphism, but then they can't be both affine as then they would have to be isomorphic. (Note that I did not just say that their rings of regular functions are isomorphic, but that the isomorphism is induced by the embedding).
More generally this argument shows that if $X$ is an affine variety of dimension at least $2$ and $P\in X$ is a closed point such that $\mathrm{depth}_P\mathscr O_X\geq 2$ (this is automatic if for example $X$ is normal, or a complete intersection in something smooth, or Cohen-Macaulay), then $X\setminus\{P\}$ is not affine.
This is an instance of Hartogs' theorem on extending holomorphic functions on normal complex analytic spaces. See this MO question for more.
A: We can easily see that the function field of $\mathbb{A}^2_k-(0,0)$ is still $k(x,y)$. So the ring of functions is of the form $f/g$ where $f$ and $g$ are polynomials. But any polynomial in 2 variables will vanish at a codim 1 sub-variety, i.e. cannot vanish at exactly 1 point. This is the Krull dimension theorem. But if you think this is too much, from the fact that $k$ is algebraically closed, you can see that $g$ must vanish at more than 1 point: for each $x$ you can solve for $y$. Thus the ring of functions on $\mathbb{A}^2_k-(0,0)$ is $k[x,y]$. Thus, if it's affine, it must be isomorphic to $\mathbb{A}^2_k$ through the identity map. But it's not. So we are done.
Another way that uses Cohomology is the follows: using $\check{\mathrm{C}}\mathrm{ech}$ cohomology, we can show that $H^1(\mathbb{A}_k^2-\{0\}, \mathcal{O}_X)$ is infinite dimensional. But if our space is in fact affine, then this must vanish, due to Serre's criterion for affineness.
A: Yes, you can do it over any field.
First, it is enough to show $\mathcal O(Y) = k[x,y]$ ($Y=A^2-0$). If that is true and $Y$ is affine, then the embedding $Y \to A^2$ must correspond to some $k$-algebra map $k[x,y] \to k[x,y]$, which is absurd.
The key point now, as in Guillermo's post, is to show that $R_{(x)} \cap R_{(y)}= R$ ($R=k[x,y]$). It will follow from the 

Fact: $(x^m, y^n)$ form a regular sequence on $R$ for all $m,n>0$   

Indeed, if $f/x^m =g/y^n$, then $fy^n=0$ modulo $x^m$, so $f=hx^m$ and we are done.
The above Fact is elementary. For example you can induct on $m$. Clearly $m=1$ is OK. Now if $m>1$, use the short exact sequence:
$$0 \to R/{(x^{m-1})} \to R/(x^m) \to R/(x) \to 0$$  
and Snake Lemma to conclude that $y^n$ is regular on the middle term as well. 
Note that I used $x,y$ abstractly and all you need is that the elements $(x,y)$ form a regular sequence on a commutative Noetherian ring $R$ to start with. Then the proof shows that $\mathcal O(Y) =R$ if $Y=\text{Spec}(R) - V(x,y)$. In fact, more general results are true for ideals of depth at least $2$. If you are interested, it will be a good motivation to learn about depth and regular sequences. 
A: Here's a short argument  over $\mathbb{C}$.
If $\mathbb{A}^2-\{0\}$ were affine, then a standard application of Morse theory [Milnor, chap 1, sect 7] would show that $H^i(\mathbb{A}^2-\{0\},\mathbb{Z})=0$ for $i>2$. But it's homotopic to $S^3$.
