Regarding continuity of a certain function This is a part of hatcher's question 2.2.26. For a pair $(X,A)$, let $X\cup CA$ be $X$ with a cone on A attached.
a)show that $X$ is a retract of $X\cup CA$ iff $A$ is contractible in $X$.
b)Show that if $A$ is contractible in $X$ then $H_n(X,A)=\tilde{H}_n(X)\bigoplus\tilde{H}_{n-1}(A)$.
Proof:Let $X$ be a retract of $X\cup CA$. Let $r$ denote this retraction. We know $CA$ deformation retracts to its tip. Let us call this deformation retraction $f_t$. Let us denote $r|CA = r'$. consider $r'(f_t)$. Consider $r'(f_t)|A$. It is evident $r'(f_0)=i:A\rightarrow X$ whereas $r'(f_1)= p\in X$.
Thus $A$ is indeed contractible in $X$.
Conversely let there be a homotopy $f_t:A\rightarrow X$ be such that $f_0=i:A\rightarrow X$ and $f_1$ is a constant map. Construct a map $F:CA\rightarrow X$ as $F([x,t])=f_t(x)$. Now we construct a retraction as follows ; Let $r|X=1$ and $r|CA=F$ this is a retraction onto $X$ and is moreover continuous because it agrees on $A$.Thus we have a retraction.\
b) Note $X\cup CA/X$ is the suspension $SA$ of $A$. Since $A$ is contractible in $X$,$X\cup CA$ retracts onto $X$. This means by the splitting lemma $\tilde{H}_n(X\cup CA)=\tilde{H}_n(X)\bigoplus \tilde{H}_n(X\cup CA/X)=\tilde{H}_n(X)\bigoplus \tilde{H}_n(SA)=\tilde{H}_n(X)\bigoplus \tilde{H}_{n-1}(A)$.
Also note $\tilde{H}_n(X\cup CA)=H_n(X\cup CA)=H_n(X\cup CA-{p},CA-{p})=H_n(X,A)$ where $p$ is the tip of the cone. The first isomorphism comes from the exact sequence of the pair while the second from excision, and the third from the deformation retraction of $CA-{p}$ onto $A$.Thus we get the required result $H_n(X,A)=\tilde{H}_n(X)\bigoplus\tilde{H}_{n-1}(A)$.
So my question is in my latter arguement regarding the converse(contractible means a retraction exists) I assume that $A$ is closed in $X$. Is there a way to extend this to an arbitrary pair (X,A) or do i have to redo my argument altogether.
 A: You do not need to assume that $A$ is closed in $X$. The space $X \cup CA$ is formally defined as follows.
Let $p : A \times I \to CA$ denote the quotient map which collapses $A \times \{1\}$ to a point. Then $A' = p(A \times \{0\})$ is a homeomorphic copy of $A$ (the base of $CA$). In fact, $i_0 : A \to CA, i_0(a) = p(a,0)  =[a,0]$, is an embedding with image $A'$. Set $i' : A' \to X, i'([a,0]) = a$. This is an embedding corresponding to the inclusion $A \to X$ under the canonical identification of $A$ with $A'$ via $i_0$. Now $X \cup CA$ is a lax notation for the adjunction space $X \cup_{i'} CA$, i.e. the quotient of the disjoint sum $X \sqcup CA$ obtained by identifying $[a,0] \in CA$ with $a \in X$. Let $q : X \sqcup CA \to X \cup CA$ denote the quotient map.
The map $R : X \sqcup CA \to X, R(x) = x, R([a,t]) = F([a,t])$, is continuous. It has the property $R([a,0]) = F([a,0]) = f_0(a) = i(a) = a = R(a)$, hence it induces a continuous map $r : X \cup CA \to X$ such that $r \circ q = R$. Here we do not need that $A$ is closed.
