An endofunction (or self-mapping or other variation) is an endomorphism in the category of sets, that is a function from a set X to X itself.
Ok, what new names we have now for
- endofunction
if endomorphism were not in the category of sets for endofunction definition?
- we can no longer use as label the word "endofunction" because
- we have a general category and not a specific category (category of Sets in this context)
- endomorphism change its name into morphism $f : x \to x$
Mathematics uses some well-established cliches for giving definitions. One of the most commonly used cliches is following. Let $X$ be a concept, denoted by an informal symbol (for example, english word) $x$, which is defined for mathematical objects of type $\mathcal{T}$ (I use the word "type" in informal meaning here, but I guess it may be formalized), and let $O$ be a mathematical object of type $\mathcal{T}$. Let also $y$ be a new informal symbol. Then we may produce a new "definition" (which is in fact an informal metamathematical notation): $$ \text{Definition. $y$ is $x$ in $O$.} $$ After the definition is given, every partial case of the concept $X$ in $O$ we may call equivalently $y$ or $x$ (when it is obvious from a context that we "talk about $O$").
In your question: $$ X=\text{a concept of endomorphism}; $$ $$ x=\text{"endomorphism" (word)}; $$ $$ \mathcal{T}=\text{all categories (or some variation of this notion, depending on foundations)}; $$ $$ O=\mathbf{Set}; $$ $$ y=\text{"endofunction" (word)} $$
Endomorphisms are defined for any category, they are simply morphisms from an object to itself. So as objects of $\mathbf{Set}$ are sets and morphisms are functions, after giving this definition we may say that endofunction is a function from a set to itself.
I apologize to the logic experts if my answer uses self-made notions, I just try to explain how the definitions work "in practice".