Let $\displaystyle X$ be a Topological space.

a . show that for a point $\displaystyle a \in X$ there is a retract $\displaystyle f : X \rightarrow {a} $

b . if $\displaystyle A \subset X$ is finite, and $\displaystyle X$ is Hausdorff with a finite amount of connected components, what is the Necessary and sufficient condition for a retract $\displaystyle f : X \rightarrow A$ ?

thanks!!