The image of a map of separable algebras I'm reading Lenstra's notes on the étale fundamental group, and I've got stuck on his exercise 3.9(c).  He says that if $A$ and $B$ are separable algebras over a field $K$, and $f:A \to B$ a $K$-algebra homomorphism, then the image of $f$ is precisely $\{b \in B: b \otimes 1 = 1 \otimes b\text{ in }B \otimes_A B\}$.
By his theorem 2.7, every separable $K$-algebra is a finite product of separable extension fields $K_i$ of $K$.  So the morphisms of two such algebras are fairly restricted: if I'm not mistaken, if $A = \prod K_i$ and $B = \prod L_j$, and $v_i$ and $w_j$ are the respective idempotents defining these splittings, then each $f(v_i)$ is a sum of distinct $w_j$, each generating an extension field of $K_i$.
I don't know how to get from this to the claim.  More generally, for any map of commutative rings $A \to B$, we have this subring $\{b\in B:b \otimes 1 = 1 \otimes b \text{ in }B \otimes_A B\}$, which I feel like I've seen in other contexts as well, though I can't remember where.  Is there a high-level way of thinking about this set, or more general conditions that tell you it's equal to $f(A)$?  Thank you in advance.
 A: Let $A$ be a field, $f: A \rightarrow B$ a map of rings. I claim first that in this baby case $f(A) = \{b: b \otimes 1 = 1 \otimes b \in B \otimes_A B \}$. Indeed, we have the inclusion $\subseteq$, and in the other direction, if $b \notin f(A)$ we may extend $1,b$ to basis $b^i$ for $B$ over $A$, as $b^i \otimes b^j$ form a basis for $B \otimes_A B$, in particular we have $1 \otimes b \neq b \otimes 1$. 
Let's reduce to this case for the question at hand: you have the natural inclusion of $A$ modules $f(A) \rightarrow \{b \in B: b \otimes 1 = 1 \otimes b\}$, to prove this is an isomorphism it suffices to do it locally (the latter is easily seen to be an $A$ module). Indeed, suppose $A = K_1 \oplus \ldots \oplus K_n$, the spectrum of $A$ is just $\mathfrak{p}_1 \ldots \mathfrak{p}_n$, where $\mathfrak{p}_i = \oplus_{j \neq i} K_j \subseteq A$. 
Fix some $\mathfrak{p}_i =: p$. Now, $A_{p}$ is just $K_i$, and $f(A)_p = f_p(A_p)$, where $f_p$ is the induced map $A_p \rightarrow B_p$. We have directly that $$\{b \in B: b \otimes 1 = 1 \otimes b \in B \otimes_A B\}_p \subseteq \{b \in B_p: b \otimes 1 = 1 \otimes b \in B_p \otimes_{A_p} B_p\}$$where we use the canonical identification $(B \otimes_A B)_p \simeq B_p \otimes_{A_p} B_p$. By our earlier analysis (of $A$ just a field) then the result follows, as all of the RHS is $f_p(A_p)$. 
