Let $\phi:\Bbb Z_n\rightarrow G$ s.t. $\phi(i)=h^i$ for $0\le i\le n$. Give necessary and sufficient condition for $\phi$ to be homomorphism. 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$.

This community wiki answer is to point out that this comment followed by this comment, both posted above by @Timkinsella (who is invited to post his own answer), form an answer to the question.
Summarising them:
1) Prove $\tilde{\phi}: \Bbb Z\to G, i\mapsto h^i$ is always a homomorphism.
2) Think of the condition on $\tilde{\phi}$ that would allow $\Bbb Z$ to be replaced by $\Bbb Z/n\Bbb Z$.

 Hint: First isomorphism theorem.

