Solution (source code)

= Solution

Put $A=k[t_1,t_2]$. The <punctured affine plane> is covered by the <principal open subschemes> $D(t_1)$ and $D(t_2)$. Since $A$ is an <integral domain>, restriction identifies its <global sections> with
$$
\Gamma(X,\mathcal O_X)=A_{t_1}\cap A_{t_2}\subset k(t_1,t_2).
$$
This intersection is $A$: if $a/t_1^r=b/t_2^s$, then $t_2^sa=t_1^rb$, and <unique factorization> forces $t_1^r$ to divide $a$. Therefore the inclusion $j:X\hookrightarrow\operatorname{Spec}A$ induces the identity on <global regular functions>.

If $X$ were an <affine scheme>, <affine scheme reconstruction from global sections> would make $j$ an <isomorphism of schemes>, because its global-section map is an isomorphism. But its image omits the closed point $(t_1,t_2)$. \b[The punctured affine plane is therefore not affine.] This is a useful example of global regular functions failing to distinguish a nonaffine open subscheme from its affine ambient space.