Image of a group equal to his kernel If we have a function $f: G\rightarrow G$ , is there an example of a group $G$ that $imf=kerf$?
I try to think about the trivial group but there is another one?
Note: $f$ is Homomorphism.
 A: Sure, there's many. Here's a family:
Take any group $H$, let $G=H\times H$ and consider
\begin{align}
H \times H &\longrightarrow H\times H, \\
(x, y) &\longmapsto (y, e_H).
\end{align}
Kernel and image are equal to $H\times\{e_H\}$.
A: Take $f\colon C_2\times C_2\rightarrow C_2\times C_2$, given by $(x,y)\mapsto (y,1)$.
Then $\ker(f)=C_2\times 1$ and $C_2\times 1=f(G)={\rm im}(G)$.
A: All you are essentially asking for is a homomorphism $f: G\rightarrow H$ such that $\operatorname{im}(f)\cong\ker(f)$. To see this, alter the codomain of $f$ to make $f$ surjective, so $f: G\rightarrow\operatorname{im}(f)$, and then compose this with the isomorphism $\phi:\operatorname{im}(f)\rightarrow\ker(f)$ to get a map $\phi f$ which, after altering the codomain again, has the required properties.
Asking for homomorphisms with isomorphism $\operatorname{im}(f)\cong\ker(f)$ rather than equality $\operatorname{im}(f)=\ker(f)$ is easier but, as the above says, equivalent.
For example, we can see that any group of order $p^2$ gives us an example: such a group $G$ has a normal subgroup $N$ of order $p$ (why?), and then the quotient group $G/N$ also has order $p$. If $f: G\rightarrow G/N$ is the associated homomorphism, we have $\operatorname{im}(f)\cong\ker(f)$ (equivalently, $N\cong G/N$), as up to isomorphism there is a single group of order $p$.
In particular, this means that cyclic groups of order $p^2$ give examples, which is a different class of examples from the other two answers.
