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


1. *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$;
2. *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](http://en.wikipedia.org/wiki/Section_%28category_theory%29). 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?



Topological retraction vs categorical retraction
The two notions agree. 


Clearly, if we have a topological retraction $r : X \to A$ we may take $f : A \to X$ to be the subspace inclusion.


Conversely, given a categorical retraction $r : X \to A$, $f : A \to X$ we have the corresponding topological retraction $r' : X \to A'$ where $A' = \mathsf{im}(f) \subseteq X$ and $r' = f \circ r$. Observe that $f : A \to A'$ is a homeomorphism since it has a continuous inverse, namely $r$ restricted to $A'$: for every $x \in A'$ there is $y \in A$ such that $x = f(y)$ and so
$$f(r(x)) = f(r(f(y)) = f(y) = x.$$
The other direction is obvious as $r \circ f = \mathsf{id}\_A$ by assumption.


This argument is going to work in any category with well-behaved images.


