Let $\phi:A \rightarrow B$ be a ring homomorphism, $M$ be an $A$-module, and $N$ a $B$-module.
Prove that
$$N \otimes_B (B \otimes_A M) \cong N \otimes_A M$$ as either $A$ or $B$-modules.
We know that $B \otimes_AM$ is a $B$-module and $N$ is an $A$-module via extension and restriction of scalars. We have that $N \cong N \otimes_BB$.
Is it legal to do this: $$N \otimes_B (B \otimes_AM) \cong (N \otimes_BB) \otimes_AM \cong N \otimes_AM$$
Yep; and that's exactly the approach I'd use.
But if you're nervous, that argument also suggests how to write down an actual function that gives the isomorphism:
and then you simply need to show that both functions are well-defined and are inverses.
To show these definitions are well-defined, we use the fact that I've expressed their values on pure tensors. Recall:
This extends inductively to repeated tensors; e.g.
You can derive this by applying the two-factor version to $U$ and $V \otimes W$, and then again to $V$ and $W$.