If X is a topological space, what would be an example of a retract of X which is not closed?

I know that if X is Hausdorff, every retract of X must be closed. So I think we need to come up with a topological space X which is not Hausdorff.

[A C X is a retract of X if there exists a continuous map r:X-->A such that r(y)=y for each y in A].