# Associativity of extension of scalar (tensor product)

I am trying to prove the following basic property $$(M \otimes_A B) \otimes_B C \cong M \otimes_A (B \otimes_B C) \cong M \otimes_A C$$ where $M$ is $A$-module, $B$ is an $A$-algebra and $C$ is $B$-algebra. (All rings are commutative.) Note that this is isomorphism of $C$-modules. Intuitively, I understand the isomorphism as "transitivity of extension of scalars": to extend scalars of $M$ from $A$ to $C$ i.e. $M \otimes_A C$, we can extend scalars of $M$ from $A$ to $B$ to get a $B$-module $M \otimes_A B$ and then extend its scalar from $B$ to $C$. I want to do it using universal (adjunction) property of tensor product; namely $P \otimes_A N$ is the module such that for any $A$-module $Q$, one has $$Hom_A(P \otimes_A N, Q) \cong Hom_A(P, Hom_A(N, Q)).$$ Unfortunately, I can only prove associativity $$(M \otimes_A B) \otimes_A C \cong M \otimes_A (B \otimes_A C)$$ as $A$-modules. Is there a universal property for the case of tensoring $M \otimes_A B$ where $B$ is $A$-algebra?

As a $B$-module, the tensor product $M\otimes_A B$ has the universal property that $\operatorname{Hom}_B(M\otimes_A B,N)\cong\operatorname{Hom}_A(M,N)$ naturally for any $B$-module $N$ (that is, $-\otimes_A B$ is left adjoint to the forgetful functor from $B$-modules to $A$-modules). Indeed, the $B$-module structure on $M\otimes_A B$ is defined by just multiplying on the second coordinate, so an $A$-bilinear map $\varphi:M\times B\to N$ induces a $B$-linear map $M\otimes_A B\to N$ iff $\varphi(m,b)=b\varphi(m,1)$ for all $b\in B$ and $m\in M$. It is then easy to check that such $\varphi$ are in bijection with $A$-linear maps $M\to N$, with $\varphi$ corresponding to the map $m\mapsto \varphi(m,1)$.