Topological retraction vs categorical retraction 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?
 A: Yes. Take $X$ to be the standard torus and $A\subseteq X$ to be any null-homotopic embedded circle. Then $A$ is not a topological retract (since the inclusion fails to be injective on homology groups, say) but it is a categorical retract, since we can just take the map $f: A\to X$ which includes the circle as the first factor (edit: and $r: X\to A$ to be projection onto the first factor).  
A: 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.
