# Functions Problem 5

### Solution

Proof: Suppose that $$r : X \rightarrow A$$ is a retraction.

Let y be an element of A. We need to find a preimage of y, i.e. an element of X that maps onto y.

Since r is a retraction, there must exist another function $$s : A \rightarrow X$$ such that $$r\circ s = id_A$$.

Consider x=s(y), which is an element of A. Since $$r\circ s = id_A$$, $$(r\circ s)(y) = y$$. That is $$r(s(y)) = y$$. That is, $$r(x) = y$$. So x is the required preimage.

Since we have found a preimage for an arbitrarily chosen element of the co-domain, r is onto.