The definition of a retract is a continuous function from X to {a} such that f(a)=a. And that pretty much nails it down for you.

For (b), assuming you mean "finite" when you write "final", think about where the points of A are distributed within the components of X.