Let $k$ be an algebraically closed field, $A$ a finitely generated $k$-algebra. Let $x,y$ be two distinct closed points of $\mathrm{Spec}(A)$. Is there an affine $k$-scheme of finite type obtained from $\mathrm{Spec}(A)$ by "gluing $x$ and $y$"? More precisely: let $\mathfrak{m}\_x$ and $\mathfrak{m}\_y$ be the maximal ideals of $A$ corresponding to $x$ and $y$, and $I=\mathfrak{m}\_x\cap \mathfrak{m}\_y$. Define $B$ to be the $k$-subalgebra of $A$ generated by $k$ and the elements of $I$. Is $B$ a finitely generated algebra over $k$? 


In Serre's book "Algebraic groups and class fields" he carries out the construction for smooth curves (i.e. $A$ normal and of dimension 1) but I don't see how to generalize this to higher dimension.



Gluing two points in an affine algebraic variety
$B$ is finitely generated. First notice that $B\subset A$ is an integral extension, since if $f\in A$, then $(f-f(x))(f-f(y))\in I$, giving you an integral equation. Then, it is easy to find a finitely generated algebra $C\subset B$ such that $C\subset A$ is integral. Then, $A$ is a finite $C$-module and thus so is $B$. Then, $B$ is finitely generated.


