I know that retract of Hausdorff space must be a closed subset.
So I was thinking any non Hausdorff space will work as example. So I thought Cofinite Topology space with infinitely many elements.
So finite element set are closed .If I choose infinite set but How to show there exist retract.I cannot visualise this.
Please give me some hint
Any help will be appreciated
No need to visualise anything: As a concrete instance, take $X=\Bbb Z$ in the cofinite topology and take $A=\Bbb N = \{n \in \Bbb Z: n \ge 0\}$, which is not closed as its complement is not finite.
Take $f(n)=|n|$ which maps $X$ to $A$ and is the identity on $A$. $f$ is continuous because the inverse image of a finite set (the only non-trivial closed subsets) is finite (so closed) because $f$ is at most $2$-to-$1$. So $f$ is a retraction of a non-Hausdorff $X$ onto a non-closed subset.
I chose these sets for the easy description, but if $X$ is infinite cofinite and $A$ is a subset of $X$ with $|A| = |X\setminus A| = |X|$, then we can also find a $2$-to-$1$ (so continuous) retraction of $X$ onto $A$, giving lots of similar examples.