Let $G$, $H$ be abelian groups and $f: G\to H$ a homomorphism. Assume that $f^*: \mathrm{Hom}(H, R) \to \mathrm{Hom}(G, R)$ (as morphisms of abelian groups, taking $R$ with its additive group structure) is an isomorphism for all commutative rings (with 1) $R$. Is then $f$ an isomorphism as well?
The question is motivated by a question on homological algebra, see here.