Let $A$ be an artinian ring and $B$ be an $A$algebra such that $B \otimes_A B \to B$ is an isomorphism, i.e. that $A \to B$ is an epimorphism in the category of commutative rings, see the Seminar Les épimorphismes d'anneaux for a detailed account. In Exposé 3, page 10, it is claimed that in this situation $A \to B$ is surjective. But the proof is only sketched and I don't understand it. Can someone fill in the details, or even better give a different proof? Remark that we may assume that $A$ is local artinian.
I won't be surprised if you already know this, but here is a proof for $A$ noetherian and/or $B$ finite over $A$: 0) We can replace $A$ with its image in $B$ and assume $A\rightarrow B$ is injective. 1) The result is clear if $A$ is a field. 2) The isomorphism $B\otimes_AB\rightarrow B$ descends to an isomorphism $\overline{B}\otimes_{\overline{A}}\overline{B}$, where the overbar means reduction mod the maximal ideal. From this and 1) we have surjectivity of $\overline{A}\rightarrow\overline{B}$. 3) Now if $A$ is noetherian we are done: By 2), $B=A+MB$ where $M$ is the maximal ideal in $A$; from this we have $B=A+M^nB$ for all $n$; but if $A$ is noetherian then $M$ is nilpotent so $B=A$. 4) Alternatively, if $B$ is finite as an $A$module, then the cokernel of $A\rightarrow B$ vanishes mod $M$ and hence vanishes by Nakayama. 

