My question is regarding a specific exercise that I'm not really sure how to approach. Suppose I have a smooth manifold $M$ and let $A$ be a closed subset. Now suppose that there exists a smooth function $f:M \to A$ such that $f|_A = id$ (smooth retract).
I want to show that $A$ is a submanifold, i.e, it is Hausdorff, second countable and locally euclidean. Hausdorff and second countable are both hereditary properties, so only the latter is left.
My attempt was to prove that if $(U, \varphi)$ is a chart around $x \in A \subset M$ for $M$, then $\left(f(U), \varphi|_{f(U)}\right)$ is the desired chart. However, I'm not sure if $f(U)$ is open. I probably should use that $A$ is closed and $f$ is a retract, but I couldn't connect both facts.
There is no need for a solution, just a hint is enough.
PS: John Lee suggested that I should ask a question instead of leaving the exercise for the community, so here it is. I rewrote my previous post here. :)
This not true. Consider two segments $C_1, C_2\subset R^2$ which are not parallel such that $C_1\cap C_2$ is a point. Take $A=C_1\bigcup C_2$ it is not a smooth manifold you have a singular point at the intersection. Consider $U_i$ a tubular neigborhood of $C_i, i=1,2$ diffeomorphic to $C_i\times [0,1]$. $X=U_1\cap U_2$ retracts to $A$ and is a manifold.