TITLE: Categories with meaningful "core" objects
QUESTION [6 upvotes]: Let $G$ be a graph. A graph $C$ is a core of $G$ if:

There is a homomorphism $G \to C$.
There is a homomorphism $C \to G$.
$C$ is smallest possible with these properties.

A core graph is well-defined up to isomorphism for any finite graph $G$. One can see that under these restrictions $C$ is a subgraph of $G$ (since otherwise the image of $C \to G$ must be a smaller graph with all these properties), and is its own core. Further, we may equivalently replace 3 with:
3'. All endomorphisms of $C$ are isomorphisms.
3' is one of the main reasons why core graphs are a useful notion (see references in the article above), so it is interesting to seek for similar objects in other categories. Let us define a core of an object $G$ as any $C$ satisfying 1, 2 and 3'.
In any category with an object $X$ both initial and terminal, $X$ is trivially a core of any object (as in $\mathbf{Grp}$, $\mathbf{Mon}$, or $\mathbf{Vect}_K$). In $\mathbf{Field}$ any object is a core of itself since any homomorphism is injective. In both of this situations the cores are kinda trivial. We could say that in the first case objects have too 'admissive' internal structure, while in the latter case objects have too 'restrictive' internal structure.
$\mathbf{Graph}$ is an example of a category with "meaningful" cores, that is, different graphs may have different cores, and there are graphs that are not cores of themselves. In $\mathbf{Ring}$ cores may be meaningful too: for example, the core of $\mathbb{Z}_n \times \mathbb{Z}_m$ is $\mathbb{Z}_{\mathrm{lcm}(n, m)}$.
Questions: In which (concrete) categories cores are meaningful? In which categories cores are defined up to isomorphism?
Late edit: Another aspect of how graph cores are interesting is that they are hard to compute (see above reference). Naturally, if cores of a category are computationally hard, then they must be meaningful in the above sense, and it feels like a good way to encapsulate their 'interestingness'. Can we say something about categories with computationally hard cores?

REPLY [3 votes]: I think of the core phenomenon as a special case of a basic fact about finite transformation monoids. Suppose we have a concrete category of finite structures such that bijective endomorphisms are isomorphisms and the image of each endomorphism is a substructure.  Then for each object $X$ there is a subject $Y$ which is a retract of $X$, any endomorphism of $Y$ is an isomorphism and $Y$ is unique up to isomorphism.  Moreover, $Y$ is of minimal cardinality among images of a morphism from $X$ to itself.
Why? Let $M$ be the endomorphism monoid of $X$.  Define the rank of an element of $M$ to be the cardinality of its image.  Let $m\in M$ have minimal rank $r$.  Then all powers of $m$ have the same rank and hence there is an idempotent $e$ achieving the rank $r$.  Let $Y=eX$.  Then $Y$ is a retract of $X$.  If $f$ is an endomorphism of $Y$, then $ife$ (where $i$ is the inclusion) is an endomorphism of $X$ and so by minimality of the rank of $e$, we have that $|eX|=|Y|\leq |fY|=|feX|\leq |eX|=|Y|$ and thus $f$ is an automorphism of $Y$ by our hypotheses.  
Suppose $Z$ is another retract of $X$, say by an idempotent $e'$, such that every endomorphism of $Z$ is an isomorphism.   Then $e'|_Y\colon Y\to Z$ and $e|_Z\colon Z\to Y$ are morphisms by restriction and hence $e|_Ze'|_Y$ is an automorphism of $Y$ and $e'|_Ye|_Z$ is an automorphism of $Z$.  It easily follows that $e'_Y$ is an isomorphism from $Y$ to $Z$.