If $r:X\to A$ is a Retraction, Then $H_n(X)\cong H_n(A)\oplus H_n(X,A)$ $\DeclareMathOperator{\im}{Im}$
Let $A$ be a subspace of a topological space $X$ such that there is a retraction $r:X\to A$ of $X$ onto $A$.

Then $H_n(X)=H_n(A)\oplus H_n(X, A)$ for all $n$.

What I tried:
Let $i:A\to X$ be the inclusion map. Then we have $r\circ i=id_A$.
We have induced homomorphisms $i_*:H_n(A)\to H_n(X)$ and $r_*:H_n(X)\to H_n(A)$. Since $r_*\circ i_*=(r\circ i)_*=(id_A)_*$ is an isomorphism, we deduce that $i_*$ is split-injective.
Therefore, $H_n(X)=i_*(H_n(A))\oplus \ker r_*$.
So is $r_*$ were kind enough to satisfy $\ker r_*\cong H_n(X, A)$ then we are done.
I am unable to show this. For suppose $\sigma+\im \partial_{n+1}^X\in \ker r_*$ for some $\sigma\in \ker \partial_n^X$, then we have $r\circ \sigma+\im \partial_{n+1}^A=0$. This means that $r\circ \sigma\in \im \partial_{n+1}^A$. 
I don't see where to go from here. 

For $A\subset X$ you have long exact sequence 
$$
\dots\to H_n(A)\to H_n(X)\to H_n(X,A)\to\dots
$$
The composition $r_*\circ i_*:H_n(A)\to H_n(X)\to H_n(A)$ is identity, so we see that $i_*:H_n(A)\to H_n(X)$ is inclusion for all $n$. Thus, we can write
$$
0\to H_n(A)\to H_n(X)\to H_n(X,A)\to0,
$$
and $r_*$ gives us splitting of this short sequence.
