I read about free abelian groups would be grateful for an example.
Let's say I have to find an homomorphism in this case:
Let $G=\langle g\rangle$ be a cyclic (and abelian) group, such that $|G|=4$.
Using free abelian groups theorem there is a unique homomorphism $\phi:\mathbb{Z}^4 \to G$
So, I have to take $\{(1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)\}$ such that $\phi(1,0,0,0),\phi(0,1,0,0),\phi(0,0,1,0),\phi(0,0,0,1)$ are elements in $G$.
$G$ has a unique generator but $\mathbb{Z}^4$ has $4$ generators.
Where is my misunderstanding?
Thanks!
The fact that $\mathbb Z^4$ is free abelian does not imply that there exists a unique homomorphism $\mathbb Z^4 \to G$.
Instead, fixing the free basis of size $4$ that you indicated and that I will denote in shorthand as $\{e_1,e_2,e_3,e_4\}$, here's what is true:
Generators of $G$ have nothing to do with this (so, even though you are mistaken that an order $4$ cyclic group has a unique generator --- it has two generators --- that is inconsequential to the post).
You can literally start with any function $f : \{e_1,e_2,e_3,e_4\} \to G$ whatsoever. Since the order of $G$ is equal to $4$, for each $i=1,...,4$ there are exactly $4$ choices of $f(e_i)$. So, altogether there are exactly $4^4 = 256$ choices for the function $f$. And therefore, given that each of these $f$'s extends to a unique $\phi$, there are exactly $256$ homomorphisms $\phi : \mathbb Z^4 \to G$.