As I understand it, given a set $A$, an endomorphism is a function $f$ which maps $A$ to itself. $f : A \rightarrow A$
So, for a concrete example, would we consider a permutation matrix an endomorphism? or, maybe just the function $\forall x \in A, f(x) = x$?
$\endgroup$ 51 Answer
$\begingroup$As implied in one of the comments, context matters.
A permutation matrix is an endomorphism when acting on the set of all orderings of a finite collection of items. But for example, the permutation $S_{213}$ that swaps the first and second element of an ordered $n$-tuple is not an endomorphisim acting on the set $\{(1,2,3), (2,3,1), (3,1,2)\}$.
Your second example, where you have specified the set $A$, is indeed always an endomorphism. It works on every element of the set $A$, and everything it can transform an element into is indeed an element of $A$.
$\endgroup$ 1