If $(G, *)$ and $(H, +)$ are both groupoids and if $f: G \to H$ is a surjective function such that $(\forall x,y \in G) f(x*y) = f(x) + f(y)$ than $f$ is called a homomorphism.
If $G=H$ the function is called endomorphism and if $f$ is bijective than it's called automorphism.
For automorphism an example would be the permutations of a set.
For homomorphism an example i found if a function $f(z) = |z|$ with property $f: C_0 \to R_0$ where $C_0,R_0$ are the usual complex and real number sets but without the element $0$.
I can't find an example of endomorphism. I guess the permutations of a set are endomorphism since the function is bijective so in itself it is surjective but i need a pure example. Could you provide one or two :)?
The function $f(x)=2x$ is an endomorphism of $\mathbb Z$; it is obviously non surjective.