A bimodule homomorphism $\def\Hom{\operatorname{Hom}}$
Let $R$ be a ring and $P_R$ be a right $R$-module. Set $Q=\Hom_R(P,R)$ and $S=\Hom_R(P,P)$, both operating on the left of $P$. This makes $P$ into an $(S,R)$-bimodule. Also, one could take $Q$ is an $(R,S)$-bimodule (indeed, by the rules $(rq)p=r(qp)$ and $(qs)p=q(sp)$, for $p,\ q,\ r,\ s$, respectively in $P,\ Q,\ R$, and $S$. Now, if we define $f:Q⊗_SP→R$ by $f(q⊗p)=qp$ then we see that $Q⊗_SP$ makes sense and it is an $(R,R)$-bimodule. My question is that why $f$ is well-defined? Thanks in advance!
 A: In order to define a map $f\colon Q\otimes_SP\to R$, you need to have a balanced map $g\colon Q\times P\to R$, in the sense that


*

*$g(q_1+q_2,p)=g(q_1,p)+g(q_2,p)$ for $q_1,q_2\in Q$, $p\in P$.

*$g(q,p_1+p_2)=g(q,p_1)+g(q,p_2)$ for $q\in Q$, $p_1,p_2\in P$,

*$g(qs,p)=g(q,sp)$, for $q\in Q$, $p\in P$ and $s\in S$.


If you have this $g$, then you can define a unique group homomorphism $f\colon Q\otimes_SP\to R$ such that $f(q\otimes p)=g(q,p)$. This is the fundamental theorem about tensor products.
The map $g$ can be defined simply by $g(q,p)=q(p)\in R$. Verifying that this is balanced is easy, as $(qs)(p)=(q\circ s)(p)=q(s(p))=q(sp)$ by definition.
Now, why is $f$ also a homomorphism of bimodules? We just need to check this on the generators of $Q\otimes_SP$; now
$$
(q\otimes p)r=q\otimes(pr)
$$
by definition, so
$$
f((q\otimes p)r)=f(q\otimes(pr))=q(pr)=q(p)r=(f(q\otimes p))r
$$
Also $r(q\otimes p)=(rq)\otimes p$, again by definition. Then
$$
f(r(q\otimes p))=f((rq)\otimes p)=(rq)(p)=r(q(p))=r(f(q\otimes p))
$$
