I want to prove that $X = \mathbb{A}^2\setminus (0,0)$ is not affine.
My attempt: If $\Bbbk[X] = \Bbbk[x,y]$ then $X$ is not affine since $(x,y) \subset \Bbbk[x,y]$ is a proper ideal, but $V(x,y) \cap X = \emptyset$. $X = \{x \ne 0\} \cup \{y \ne 0\}$ therefore i want to say that $\Bbbk[X] = \Bbbk[x,y,y^{-1}] \cap \Bbbk[x,y,x^{-1}] = \Bbbk[x,y]$.
But i can't prove rigorously both steps.
Suppose that $\mathbb{A}^2 \setminus \{\left(0,0\right)\}$ is affine. Let $i \colon \mathbb{A}^2 \setminus \{\left(0,0\right)\} \hookrightarrow \mathbb{A}^2 $ be the inclusion map. Then $i$ induces $i^* \colon \mathcal{O}_{\mathbb{A}^2}\left( \mathbb{A}^2\right) \to \mathcal{O}_{\mathbb{A}^2 \setminus \{\left(0,0\right)\}}\left( \mathbb{A}^2 \setminus \{\left(0,0\right)\}\right)$. We have the following identifications. $\mathcal{O}_{\mathbb{A}^2}\left( \mathbb{A}^2\right)$ is just the ring of polynomials in two variables $k\left[X,Y\right]$, and we know that $\mathcal{O}_{\mathbb{A}^2 \setminus \{\left(0,0\right)\}}\left( \mathbb{A}^2 \setminus \{\left(0,0\right)\}\right) = \mathcal{O}_{\mathbb{A}^2 }\left( \mathbb{A}^2 \setminus \{\left(0,0\right)\}\right) = k\left[X,Y\right]$. So $i^*$ is just the identity map, an isomorphism. This says that $i \colon \mathbb{A}^2 \setminus \{\left(0,0\right)\} \hookrightarrow \mathbb{A}^2 $ is an isomorphism. This is a contradiction since $i$ is not onto.