If $A$, $B$ are abelian groups such that $\mathrm{Hom}(A, G) \cong \mathrm{Hom}(B, G)$ for all abelian groups $G$, must $A$ and $B$ be isomorphic? $\DeclareMathOperator\Hom{Hom}$The question is in the title. If the isomorphism $\Hom(A, G) \cong \Hom(B, G)$ is natural in $G$ then this is just the Yoneda Lemma. If $A$ and $B$ are finitely generated this is also true by the structure theorem.
However this sounds like it should be false in general, else it would imply by Yoneda that if $\Hom(A, -)$ and $\Hom(B, -)$ are (a priori not naturally) isomorphic, then they are also isomorphic in a natural way (though possibly by a different set of isomorphisms).
The question of course immediately generalizes to $R$-modules.

Edit: Some context (that isn't really relevant for the question)
I'm interested in this question in light of the universal coefficient theorem for Cohomology. A positive answer would imply that knowing all Cohomology groups of a space, with arbitrary coefficients, would already determine its Homology (although I think it is conceivable that this topological statement can be proven in a different way).
 A: I just stumbled across the answer to this in Fuchs' 2015 book on Abelian Groups.
The papers
Hill, Paul, Two problems of Fuchs concerning tor and hom, J. Algebra 19, 379-383 (1971). ZBL0228.20027.
and a 1974 paper of Sebel'din that I've not been able to find, and seems to be in Russian, which means that I probably wouldn't be able to understand it even if I did:
Homomorphism groups of complete direct sums of torsion-free abelian
groups of rank 1 [Russian]. Tomsk. Gos. Univ., Tomsk 1, 121–122 (1974)
give counterexamples where the groups $A$ and $B$ are $p$-groups and torsion-free groups respectively.
But from Fuchs' account, Sebel'din's example is fairly simple.
Let $S=\mathbb{Z}^{(\omega)}$ be the direct sum of countably many copies of $\mathbb{Z}$, and let $A=S\oplus\mathbb{Q}$ and $B=S\oplus\mathbb{Q}\oplus\mathbb{Q}$.
Then $A\not\cong B$, but $\operatorname{Hom}(A,G)\cong\operatorname{Hom}(B,G)$  for all abelian groups $G$.
It's a fun exercise to verify this, and for me it was an ISHTOT moment when I did, so I won't spoil it for you.
