The exercise reads
Let $G$ be a group, $h$ and element of $G$, and $n$ a positive integer. Let $\phi : \mathbb{Z}_n\rightarrow G$ be defined by $\phi(i)=h^i$ for $0\leq i\leq n$. Give a necessary and sufficient condition (in terms of $h$ and $n$) for $\phi$ to be a homomorphism. Prove your assertion.
I always have problems with necessary and sufficient arguments, because I do not know how to prove. I know it implies an if and only if, but I'm not sure exactly over which is used. Now, if I look at the answer, it says:
The map is a homomorphism if and only if $h^n=e$, the identity in $G$.
But how do you know that I have to prove $h^n=e$?
I would have thought that I have to prove $\phi(n+m)=\phi(n)\phi(m)$, so it's quite confusing to think that we have to prove $h^n=e$.