Is the tensor product over $B$ of two flat $A$-modules flat over $A$?

Not in general, not even if $M$ and $N$ are, in fact $B$-algebras. To see this, let $A = k[t]$ be the ring of polynomials in one indeterminate $t$ over a field $k$, and $B = k[x,y]$ be the ring of polynomials in two indeterminates $x,y$ over $k$ made into an $A$-algebra by mapping $t$ to $x+y$. Let $M = B/(y)$ and $N = B/(x)$ be the quotient rings, emphatically not flat as $B$-modules but still flat as $A$-modules because in fact $M = k[x]$ with $t$ being mapped to $x$ and $N = k[y]$ with $t$ being mapped to $y$ are both even isomorphic to $A$. Yet the tensor product $M \otimes_B N$ is $B / (x,y) = k$ which is not flat as an $A$-module.

This is probably easier to view geometrically: $\mathop{\mathrm{Spec}} M$ and $\mathop{\mathrm{Spec}} N$ are two lines in the plane $\mathop{\mathrm{Spec}} B$ whose intersection is a point: each line maps flatly, and even isomorphically, to the line $\mathop{\mathrm{Spec}} A$, but their intersection (which is their fiber product over the plane) does not map flatly.

Very nice question, though!


Assume that as $B$-modules, you have that $N= B\otimes_A N$: note that this is generally false. There is an obvious map $B\otimes_A N\to N$ that sends $b\otimes n\to bn$. One might be tempted to use the functional inverse $n\to 1\otimes n$, but this is not necessarily $B$-linear, unless say $A\to B$ is onto. If it were true, then the argument goes through. See this. As an example of how $B$ might definitely not be isomorphic to $B\otimes_A B$, take $B$ to be a $k$-algebra with $k$ a field, $k\to B$ the structure map, and say $B$ is finitely dimensional of dimension $>1$. Then $B\otimes_k B$ has dimension strictly greater than $B$.

Now take $C$ an exact sequence. Then $N\otimes_A C$ is exact, and since $B$ is flat, so is $B\otimes_A N\otimes_A C$. Now write $$M\otimes_B N =(M\otimes_A B)\otimes_B (B\otimes_A N)$$

Then $M\otimes_B N\otimes C$ is obtained from $B\otimes_A N\otimes_A C$ by tensoring first over $B$ with $B$, which preserves exactness, and then with $M$ over $A$, which also does.