Calculating Hom(A,B) I have been studying modules and homological algebra as of late but somehow I have missed how to calculate Hom(A,B) for abelian groups, modules and Hom(A,_)/Hom(_,B) for exact sequences. I have no problem with the abstract nonsense in the subject. But explicit examples are useful and this construction is seldom mentioned explicitly in texts so I suspect it's pretty trivial but I'd still like someone to write this out for me.
Is it as as simple as finding generators in A and picking elements in B to send them to?
(with careful adjectives of course, but I am looking for the general idea.)
Also some examples would be really helpful! (If they show a general idea, not just some clever construction.)
Thanks!
 A: I guess there are probably intelligent things to say in general, but I don't really know what to say beyond "a homomorphism is specified by what it does to generators, and specifying the images of the generators gives a homomorphism if and only if all relations are sent to zero." So let's work through examples instead. I make heavy use of universal properties. 
$\mathbb{Z}$ is the free abelian group on one generator. This means that $\text{Hom}(\mathbb{Z}, A)$ can be canonically identified with $A$ (where the identification sends a homomorphism to the image of $1$). 
$\mathbb{Z}/p\mathbb{Z}$ is the free abelian group on a generator of order $p$. This means that $\text{Hom}(\mathbb{Z}/p\mathbb{Z}, A)$ can be canonically identified with the subgroup of all elements of $A$ of order (dividing) $p$.
$\mathbb{Q}$ is the colimit of its subgroups $\frac{1}{n} \mathbb{Z}$ with the obvious inclusions, so $\text{Hom}(\mathbb{Q}, A)$ can be canonically identified with the appropriate limit of copies of $\text{Hom}(\mathbb{Z}, A) \cong A$. The image of $1 \in \mathbb{Q}$ must be divisible, so if $A$ has no divisible elements, then $\text{Hom}(\mathbb{Q}, A) = 0$. If $A$ is torsion-free, then $\text{Hom}(\mathbb{Q}, A)$ can be canonically identified with the subgroup of divisible elements of $A$, since in this case the image of $1 \in \mathbb{Q}$ uniquely specifies a homomorphism. 
That takes care of all combinations of $\mathbb{Z}, \mathbb{Z}/p\mathbb{Z}, \mathbb{Q}$, but it's probably worth saying some things about homomorphisms into these groups as well.
A homomorphism into $\mathbb{Z}$ has image $n \mathbb{Z}$ for some $n \ge 0$. If $n > 0$, then the image is isomorphic to $\mathbb{Z}$. Any surjection onto $\mathbb{Z}$ can be split, since $1 \in \mathbb{Z}$ can be sent to any element in its preimage, so any element of an abelian group $A$ which has nonzero image under a homomorphism $A \to \mathbb{Z}$ must have infinite order, and the subgroup it generates must be a direct summand of $A$, and this necessary condition is also sufficient.
A homomorphism $A \to \mathbb{Z}/p\mathbb{Z}$ necessarily factors through $A/pA$, which is a vector space over $\mathbb{F}_p$. Hence $\text{Hom}(A, \mathbb{Z}/p\mathbb{Z})$ can be canonically identified with the dual vector space $(A/pA)^{\ast}$ over $\mathbb{F}_p$. 
Homomorphisms into $\mathbb{Q}$ seem somewhat complicated in general. 
For more complicated examples, I guess the smart thing to do is write down short exact sequences and compute Ext groups. I don't know much about this, though, and I'm not sure the examples you're having trouble with merit techniques of this level. 
