Hom and direct sums
Let $R$ be a ring (not necessarily commutative).
Let $A$ be a left $R$-module. When does the functor $\text{Hom}(A,-)$ preserve direct sums - in the category of left $R$-modules? For example, this is certainly true when $A$ is free and finitely generated (EDIT: or finitely generated in general, as suggested by Pierre-Yves).
Do we always need the finitely generated condition?
Solution 1:
There have been two previous incorrect versions of the answer. I apologize for them, and thank Mariano for his friendly and efficient help. Thank you also to Evariste!
Here are the claims:
(1) If $A$ is finitely generated, then the functor $\text{Hom}_R(A,?)$ preserves direct sums.
(2) If there is an increasing sequence $(A_i)_{i\ge1}$ of proper submodules whose union is $A$, then the functor $\text{Hom}_R(A,?)$ does not preserve all the direct sums.
I don't know if such a sequence $(A_i)_{i\ge1}$ exists whenever $A$ is not finitely generated. (And I'm very anxious to know if this is true.)
Proof of (1). We have a natural $\mathbb Z$-linear injection
$$
F:\bigoplus_i\ \text{Hom}_R(A,B_i)\to\text{Hom}_R(A,\oplus_i\ B_i).
$$
Moreover $g\in\text{Hom}_R(A,\oplus_i\ B_i)$ is in the image of $F$ if and only if $g(A)$ is contained into the sum of finitely many $B_i$.
In particular $F$ is bijective if $A$ is finitely generated.
Proof of (2). The natural $R$-linear map from $A$ into $\oplus\,A/A_i$ is not in the image of $F$.
EDIT. Here are three references:
http://ncatlab.org/nlab/show/coproduct-preserving+representable
Preservation of direct sums and finite generation
https://mathoverflow.net/questions/59282/sums-compact-objects-f-g-objects-in-categories-of-modules/81333#81333