Let $(X,\tau)$ be a topological space. We say that $A\subseteq X$ is a

*topological*retract if there is a continuous map $r:X\to A$ onto a subspace $A \subseteq X$ such that for all $a\in A$ we have $r(a) = a$;*categorical*retract if there are continouus maps $r: X\to A$ and $f: A\to X$ such that $r \circ f = \textrm{id}_A$. (That is $r: X\to A$ is a retraction in the categorical sense. And obviously, $f$ has to be injective, but we do not require that $f$ is the inclusion map!)

Obviously, any topological retract is categorical. Is there an example of a categorical retract that is not a topological retract?