# When does there exist a commutative ring $C$ that contains rings $A$ and $B$ as a subring?

The statement I'm trying to prove is the following:

Let $A$ and $B$ be commutative rings, both of characteristic $0$. Then there exists a commutative ring $C$ that contains both $A$ and $B$ as subrings if and only if the implications $nA = A \implies \{b \in B : nb = 0\} = \{0\}$ and $nB = B \implies \{a \in A : na = 0\} = \{0\}$ hold for every integer $n$.

I have proved the 'only if' part in the following way: Assume that there exists a ring $C$ as described above and $nA = A$ holds for some integer $n$, and let $b \in B$ be an element such that $nb = 0$. Then in $C$ we find that $b = n^{-1} n b = n^{-1} \cdot 0 = 0$, where $n^{-1}$ is an element of $A$ with the property that $n^{-1} \cdot n = 1$.

I'm having trouble proving the 'if' part. What I've gotten so far is that we can basically view $C$ as the tensor product $A \otimes_\mathbb{Z} B$, with the inclusion from $A$ being $a \mapsto a \otimes 1$, and similar for $B$. What is left to show is that these maps are actually injective, or in other words, that $a \otimes 1 = 0$ implies $a = 0$. I was thinking of constructing a bilinear map $f:A \times B \rightarrow G$ to an abelian group $G$ with $f(a,1) \neq 0$ for a specified $a \in A$. However I don't see how to do this, because there is no information about the structure of $A$ and $B$ at all. Any other ways of proving the original statement by directly constructing $C$ without using the tensor product come down to mostly the same problem.

The general question you need to answer is when, for a $\mathbb Z$-module (i.e. abelian group) $A$ and a commutative ring $B$, the morphism $A \to A \otimes B$ given by $a \mapsto a \otimes 1$ is injective. Using the fact that $A$ is the direct limit of its f.g. submodules, and that tensor products commute with direct limits, one reduces to the case that $A$ is f.g., and hence write $A = T \oplus \mathbb Z^r$ for some finite ab. gp. $T$ and some natural number $r$.
If $r = 0$, then we need that $T \to T \otimes B$ is injective, while if $r > 0$, then we need this together with $\mathbb Z \to B$ is injective.
Writing $T$ as the sum of cyclic subgroups, we reduce the first question to the case when $T = \mathbb Z/n\mathbb Z$ for some $n$, in which case we need that $\mathbb Z/n\mathbb Z \to B/nB$ is injective.
So the conclusion is that for $A \to A\otimes B$ to be injective, we need $\mathbb Z/n \to B/nB$ to be injective for each $n$ such that $A$ contains an element of order $n$, while if $A$ also contains torsion free elements, then we need $\mathbb Z \to B$ to be injective as well.
If $A$ and $B$ are both rings, then we can reverse the roles of $A$ and $B$ to get corresponding conditions on $A$ that guarantee $B \to A\otimes B$ is injective.
The statement is false. For instance, $A=\mathbf Z$ and $B=\mathbf Z/p$ satisfy the condition, but a ring containing both as subrings would be both of characteristic 0 and of characteristic p, which is absurd. Perhaps you made a transcription error?