Let $A$ be a commutative ring with $1$, and $B\subseteq A$ be a subring. 



> 
> Is there a simple condition on $B$ and $A$ guaranteeing that $B\to A\rightrightarrows A\otimes\_B A$ is an equalizer?  
> 
>  In other words, when does $a\otimes\_B 1 = 1\otimes\_B a$ imply that $a\in B$?
> 
> 
> 


This always holds, for example, if $B=K$ is a field and $A=L$ is a finite separable extension of $K$. For then, if $\ell\otimes 1 = 1\otimes \ell$ in $L\otimes\_K L$, the same clearly holds in $\bar K\otimes\_K L$, where $\bar K$ is a separable closure of $K$ containing $L$. But the $\bar K$-algebra homomorphism $\bar K\otimes\_K L\to \bar K^{\mathrm{Hom}\_K(L,\bar K)}$ sending $\alpha\otimes\ell\mapsto (\alpha\cdot s(\ell))\_{s:L\to\bar K}$ is an isomorphism, and the equation becomes $\ell = s(\ell)$ for all $s:L\to \bar K$. But this means $\ell$ is fixed by the action of the absolute Galois group of $K$ (which acts transitively on the $s$), so $\ell\in K$.


Does the result hold for general $B$ and $A$? If not, is there a simple condition describing when it does hold? Or, failing that, is there a simpler proof in the case of a separable field extension, that doesn't need Galois theory?



When is this diagram of tensor powers an equalizer?
I think what you want is exactly that the dominion (in the sense of Isbell) of $B$ in $A$ be equal to $B$. 


Recall that if you are in a category of algebras (in the sense of Universal Algebra), and $B\subseteq A$ is a subalgebra of $A$, then the **dominion of $B$ in $A$** (relative to the category of context) is the set
$$\{a\in A\mid \forall C\forall f,g\colon A\to C (f|\_B=g|\_B\implies f(a)=g(a))\}.$$


If $x$ lies in the dominion of $B$ in $A$, then the fact that the two embeddings of $A$ into $A\otimes\_B A$ agree on $B$ implies that they agree on $x$; that is, $x\otimes 1=1\otimes x$. Conversely, suppose that the two embeddings of $A$ into $A\otimes\_B A$ agree on $x$; if $C$ is any commutative ring and $f,g\colon A\to C$ are two maps that agree on $B$, then the universal property of $A\otimes\_B A$ guarantees a homomorphism $\Phi\colon A\otimes\_B A\to C$ such that $f = \Phi\circ\lambda$ and $g=\Phi\circ\rho$, where $\lambda$ and $\rho$ are the left and right embeddings; then since $\lambda(x)=\rho(x)$, we conclude that $f(x)=g(x)$. Hence any element of the equalizer is in th dominion.


A characterization of dominions in the category of commutative rings is given in the Isbell-Mazet-Silver Zigzag Theorem: the dominion of $B$ in $A$ consists precisely of the elements of $A$ that can be written in the form $XYZ$, where $X$ is a row matrix, $Z$ is a column matrix, $Y$ is a square matrix of the appropriate size, $X$, $Y$, and $Z$ have entries in $A$, and $XY$ and $YZ$ have entries in $B$.


(See also this [previous post](https://mathoverflow.net/questions/109/what-do-epimorphisms-of-commutative-rings-look-like/139#139).)


So the inclusion of $B$ is the equalizer of the left and right embeddings if and only if $B$ is equal to its own dominion in $A$. 


(Essentially, when the category is right-closed, the dominion of $B$ in $A$ is always equal to the equalizer of the two embeddings $A\to A\amalg\_{B}A$; in the category of commutative rings the tensor product functions as a binary coproduct, hence the dominion of $B$ in $A$ is the equalizer of the two embeddings $A\to A\otimes\_B A$; but this description does not actually answer your question, it just asks it in a different language; so the actual answer you want is contained in the Isbell-Mazet-Silver Zigzag Theorem, when all is said and done.)


