# The identity element of the group of all group homomorphisms

Let $G,H$ be two abelian groups and $Hom(G,H)$ be the set of all group homomorphisms from $G$ to $H$. I am told this is a group, but what is the identity element? If it is the identity on $H$, then for $f \in Hom(G,H)$

$$f \circ id_H$$ is ill defined, because $f$ maps from $G$ to $H$ not the other way around. If the identity element is $id_G$, then

$$id_G \circ f$$ is ill defined for similar reasons.

Can somebody clear this up, how is the identity element defined in such a group?

The group operation on $$\text{hom}(G,H)$$ is pointwise addition. Hence the neutral element is the zero map, $$0\colon G\to H$$ which takes the constant value $$0$$ on all of $$G.$$ Then $$(f+0)(g) = f(g) + 0(g) = f(g) + 0 = f(g)$$ for all $$g\in G$$, so $$f+0=f.$$
If you want to consider a structure where the operation is composition of maps, you will need the domain and codomain of the maps to be the same. Thus the group of automorphisms (invertible homomorphisms with matching domain and codomain) $$\text{Aut}(G)$$ is indeed a group, under composition of functions, with identity element the identity map $$\text{id}_G$$.
In the event that $$G$$ is abelian, then $$\text{Aut}(G)\subseteq\text{Hom}(G,G)$$ and so the set of automorphisms has two available group structures. One with pointwise addition as the operation, and the zero map as the identity. And one with function composition as the operation, and the identity map as the identity. In other words, it is a ring. The notation $$\text{Aut}(G)$$ usually implies including at least the multiplicative operation, or both.
It's the homomorphism $f$ defined by $f(g)=e_H\ \forall g\in G$ ($e_H$ being the neutral element of $H$) The product of two elements $f_1$ and $f_2$ of $Hom(G,H)$ is the homorphism $f_1f_2$ defined by $(f_1f_2)(g)=f_1(g)f_2(g) \ \forall g\in G$ and not $f_1of_2$ (which doesn't make sense in general).