TITLE: When is $\mathrm{Hom}(A,R) \otimes B =\mathrm{Hom}(A,B)$?
QUESTION [8 upvotes]: It is simple to show that if $A,B$ are vector spaces, then $A^* \otimes B = \text{Hom}(A,B)$, where $A^*$ is the dual of $A$. To what extent does this hold for modules, where we should interpret $B^*$ as $\text{Hom}(B,R)$?

REPLY [13 votes]: I think I learned something here, so I'll record it as an answer.
Let $R$ be a commutative ring.  For an $R$-module $A$, the following are equivalent:
(i) $A$ is finitely generated projective.
(ii) For all $R$-modules $B$ the natural map $\Phi: A^{\vee} \otimes B \rightarrow \operatorname{Hom}(A,B)$ -- i.e., the one induced by $(f,b) \mapsto (a \mapsto f(a)b)$ -- is an isomorphism of $R$-modules.
(iii) The natural map $\Phi: A^{\vee} \otimes A \rightarrow \operatorname{Hom}(A,A)$ is an isomorphism of $R$-modules.
Proof: (i) $\implies$ (ii) is given in Akhil's answer.  An (arguably) more purely commutative algebraic proof is given in my comment to his answer.  Namely, you have the map $\Phi$ which you want to show is an isomorphism, so it suffices to show that $\Phi_{\mathfrak{p}}$ is an isomorphism for all prime ideals $\mathfrak{p}$ (for this see e.g. $\S 7.7$ of these notes).  Since a finitely generated projective module over a local ring is free ($\S 3.5.4$ of the notes), we reduce to the case of $A$ finitely generated and free, and this is easy.
(ii) $\implies$ (iii) is immediate.
(iii) $\implies$ (i): Let $\Phi^{-1}(1_A) = \sum_{i=1}^m f_i \otimes a_i$.  Then we have that for all $a \in A$, $a = \sum_{i=1}^m f_i(a) a_i$.  By the Dual Basis Lemma ($\S 3.5.3$), this implies that $A$ is finitely generated and projective.