I have updated my question based on the comments. I think I can solve the problem. But I hope you can help me verify it.
I am reviewing Algebraic Topology to prepare for my Qual. I have this problem
"Let $X$ be a cell complex and $$X_0\subset X_1\subset X_2\subset \cdots$$ a sequence of subcomplexes such that $X=\cup_i X_i$. Suppose that each $X_i$ is a retract of $X_{i+1}$. Prove that $X_0$ is a retract of $X$."
The materials for my past course is the book of Hatcher. I learned some materials about CW complexes like Whitehead's theorems. However, I don't think there are theorems about the relation between CW-complex and retracts.
For example, this question $X$ a CW complex is contractible if it's the union of an increasing sequence is clearly related to Whitehead's theorem. So unlike that, I do not know how to approach my problem.
Say $f_i:X_i\to X_{i-1}$ is the retraction. Then I construct $f:\cup X_i\to X_0$ where if $x\in X_n$, then we define $f(x):=f_1 ...f_{n-1}f_n(x)$. This map is well-defined. But how can I prove that it is continuous? So since $X$ is CW-complex, by weak topology, it suffices to show that $f^{-1}(A)\cap X_i$ is open in $X_i$. However, this is obvious since $f^{-1}(A)\cap X_i=(f_1...f_i)^{-1}(A)$ is an open set since $f_1...f_i$ is continuous.
I was wrong, I need $f^{-1}(A)\cap S_i$ is open in $S_i$ is the $i$-skeleton of $X$. Clearly I abused notations. So how can I go from $X_i$ to $S_i$?
The retractions $f_i : X_i \to X_{i-1}$ give us retractions $F_i = f_1 \circ \ldots \circ f_i : X_i \to X_0$. Obviously $F_{i+1} \mid_{X_i} = F_i$. Thus we get a well-defined function $F : X \to X_0$ satisyfying $F \mid_{X_i} = F_i$. A function defined on a cell-complex is continuous iff its restriction to all closed cells is continuous. But each each closed cell $c$ is contained in some $X_i$, thus $F \mid_c$ is continuous.