TITLE: Restriction of scalars and tensor product
QUESTION [8 upvotes]: All rings I'll consider will be commutative with identity.
Given a homomorphism $f:R \to S$ we can give an $S$-module an $R$-module structure via restriction of scalars. In particular, $S$ can be thought of as an $R$-module with action $$r \circ s = f(r) \cdot s$$
I've long thought that, as an $R$-module, $S \otimes_R S \simeq S$, since it is the quotient of $S \otimes_S S$ by the ideal genreated by relations $(s_1 \circ r) \otimes s_2 = s_1 \otimes (r \circ s_2)$, or equivalently $f(r) \cdot s_1 \otimes s_2 = s_1 \otimes f(r) \cdot s_2$. Since $S \otimes_S S \simeq S$ via the map $s_1 \otimes s_2 \mapsto s_1 s_2$ it seemed like the ideal we were quotienting by was trivial. 
Thinking about this though, $\mathbb{C} \otimes_R \mathbb{C} \simeq \mathbb{C} \oplus \mathbb{C}$
Are there any conditions on $R,S$ that would make $S \otimes_R S \simeq S$, as an $R$-module? For example $\mathbb{Q} \otimes_{\mathbb{Z}} \mathbb{Q} \simeq \mathbb{Q}$ holds, as well as $\mathbb{Z}/p \otimes_{\mathbb{Z}} \mathbb{Z}/p \simeq \mathbb{Z}/p$

REPLY [2 votes]: Let $\varrho:R\to S$ be an homomorphism of commutative rings.
  Then the canonical mapping
  \begin{align*}
&\eta:S\to S\otimes_R S&
&x\mapsto(x\otimes 1)
\end{align*}
  is surjective if and only if $\varrho:R\to S$ is a ring epimorphism.

Let
\begin{align*}
&\eta':S\to S\otimes_R S&
&x\mapsto(1\otimes x)
\end{align*}
If $\varrho:R\to S$ is a ring epimorphism, then $\eta\circ\varrho=\eta'\circ\varrho$ implies $\eta=\eta'$.
Consequently, $x\otimes 1=1\otimes x$ in $S\otimes_RS$ for all $x\in S$.
Then for all $x,y\in S$ we have
\begin{align}
x\otimes y
&=(x\otimes 1)(1\otimes y)\\
&=(x\otimes 1)(y\otimes 1)\\
&=(x\otimes 1)(y\otimes 1)\\
&=xy\otimes 1
\end{align}
hence $\operatorname{Im}\eta=S\otimes_RS$.
Conversely, if $\operatorname{Im}\eta=S\otimes_RS$, then $\eta:S\to S\otimes_RS$ is bijective and it's inverse is
\begin{align}
&\mu:S\otimes_RS\to S&
&x\otimes y\mapsto xy
\end{align}
which is thus injective.
Consequently, $x\otimes 1=1\otimes x$ for all $x\in S$ thus proving $\eta=\eta'$.
Now let $\xi,\xi':S\to T$ be two ring homomorphisms such that $\xi\circ\varrho=\xi'\circ\varrho$.
Then there exists an $R$-algebra structure on $C$ making $\xi,\xi'$ both $R$-algebra homomorphisms.
Consider the map $\xi\otimes\xi':S\otimes_RS\to C\otimes_R C$.
Then
\begin{align}
\xi
&=(\xi\otimes\xi')\circ\eta\\
&=(\xi\otimes\xi')\circ\eta'\\
&=\xi'
\end{align}
which proves that $\varrho:R\to S$ is a ring epimorphism.