Let $G$ be a group, and let $N$ be a normal subgroup of $G$. Then there is the canonical homomorphism $\phi$ of $G$ onto $G/N$ with kernel $N$. This homomorphism is defined as follows: $\phi(g) \colon= Ng \ $ for all $g \in G$.
In which cases can we also define a homomorphism $\psi$ of $G$ into $G$ with kernel equal to $N$? Of course we can do so when $N$ is either $\{e\}$ or $G$ itself. Could there be any other cases when this is possible?
I know that this is not always possible: e.g., consider $Z$ under addition with subgroup $2Z$. Now if there were a homomorphism $\psi$ of $Z$ into $Z$ with kernel equal to $2Z$, then we would have $Z_2 \cong Z/2Z$, which in turn is isomorphic to a subgroup of $Z$, thereby making $Z_2$, a group of order $2$, isomorphic to a subgroup of $Z$. However, every subgroup of $Z$ other than $\{0\}$ is of infinite order.
Yes to your question's title [before it was changed as homomorphism $\to$ endomorphism] question: in fact, it is a characterization of normal subgroups: a subgroup is normal in its group iff it is the kernel of some homomorphism from that group to another one.
In the case of your "this is not always possible": you're confusing things here. We indeed have that $\;2\Bbb Z=\ker\phi\;$ , with $\;\phi:\Bbb Z\to \Bbb Z_2:=\Bbb Z/2\Bbb Z\;$ .
It isn't true that $\;\Bbb Z_2\cong\Bbb Z\;$ or to a subgroup of it, since any non-trivial subgroup of the integers is isomorphic to the integers, and $\;\Bbb Z_2\;$ is finite.