Let $M$ be a module over some ring $A$ and let $B$ be some ring containing $A$ (or more generally let $\rho : A \to B$ be a ring homomorphism). Then we can endow $M \otimes_A B$ with a $B$-module structure (on the right) : this is called extension of scalars, and it is easy to see that if $M$ is free, then so is the module obtained from $M$ by extension of the scalars.
Now let $A$ be some arbitrary ring, $E$ some $(A,A)$-bimodule (meaning that $E$ is at the same time a left $A$-module and a right $A$-module such that $a.(x.a')=(a.x).a'$). Note that we don't assume $A$ is commutative. Let $B=A \times E$ and make $B$ a ring : $(a,x).(a',x')=(aa',ax'+xa')$. Then $A$ is a subring of $B$ and $E$ is an ideal of the ring $B$.
I want to prove the following : if the (right) $A$-module $M$ is such that the module obtained from $M$ by extension of scalars to $B$ (that is, the $B$-module $M \otimes_A B$) is free, then $M$ must be free as well.
The difficulty lies in the fact that the canonical homomorphism $M \otimes_A B \to M$ (which maps $m \otimes (a,x)$ to $ma$) is not injective. Otherwise, it would be easy, because this homomorphism is clearly onto.
Thank you for your help.
Please note that this question is related to this one: If $M\oplus M$ is free, is $M$ free?
Indeed let $B$ be the module $A \times A$. Then it is false that "$M \otimes_A B$ free implies $M$ free" because this statement may be rewritten as "$M \oplus M$ free implies $M$ free", and the latter is false.
But my question is different because asking that $M \otimes_A B$ be free (as a $B$-module) is not the same assumption.