Understanding $CW$ approximation theorem. The statement is the following:

Approximation theorem: Let $A$ be a $CW$ and $k \in \mathbb{Z} \cup \left\lbrace-1\right\rbrace$. Let $Y$ be a topological space with $f:
 A \longmapsto Y$ continuous such that $f_*$ is an isomorphism for
$i<k$ and surjective for $i=k$.
Then for all $n>k$ or $n="\infty"$ exists a $CW$ complex $X$ such that
$A \subset X$ as subcomplex, and $F:X \longmapsto Y$ which exstends
$f$ and such that $F_*$ is an isomorphism for $i<n$ and surjective for
$i=n$.

The theorem is proved by induction on $n$, and there are three facts that I don't understand. Let me explain better giving a sketch of the proof given in class before asking the questions.
For $n\geq 2$ we can suppose $f:A \longmapsto Y$ to be an inclusion thinking $Y$ as the mapping cylinder of $f$. So we can assume thanks to the hypothesis that $(Y,A)$ is $(n-1)-$connected.
Now we choose $(\phi_j,\varphi_j): (\mathbb{D}^n,\mathbb{S}^{n-1})\longmapsto(Y,A,\star)$ that are generator of $\pi_n(Y,A,\star)$ as $\pi_1(A)-$module.
Then we attach $n$-cells to $A$ using $\varphi_j$, in particular, suppose to add just a cell. We define $g : \mathbb{D}^n \longmapsto A \sqcup  \mathbb{D}^n$ defined by $\begin{cases}\varphi(x) & x \in \mathbb{S}^{n-1} \\ x & x \in \mathbb{D}^{n}\end{cases}$.
Repeat this definition for every cell.
The we extend defining an $F : A \sqcup  \mathbb{D}^n \longmapsto Y$ in the obvious way : $\begin{cases} f(x) & x \in A \\ \phi(x) & x \in \mathbb{D}^n \end{cases}$, with similar definition if we have more than one cell.
The attaching map of $X$, i.e $g_j$, represent classes in $\pi_{n}(X,A,\star)$ and they help to prove the surjectivity of $F_*$. We conclude by $5-$Lemma applied to the following commutative diagram, (which arises from the long exact sequence of the pair in homotopy) that the first $F_*$ is surjective and the last one is injective.
$$\begin{array}{ccccccccc}
\to \pi_n(A) & \to & \pi_n(X) & \to & \pi_n(X,A) & \to & \pi_{n-1}(A) & \to & \pi_{n-1}(X) & \to & \pi_{n-1}(X,A)=0\\\
\downarrow{id_*} & & \downarrow{F_*} & & \downarrow{F_*} & & \downarrow{id_*} & & \downarrow{F_*} && \downarrow\\\
\to \pi_n(A) & \to & \pi_n(Y) & \to & \pi_n(Y,A) & \to & \pi_{n-1}(A) & \to & \pi_{n-1}(Y) & \to & 0
\end{array}$$
Questions:

*

*Why do we need to ask to choose generators of $\pi_n(Y,A,\star)$ as $\pi_1(A)-$module? I'm aware of the action of $\pi_1(A)$ on $\pi_n(Y,A,\star)$, but I don't see where is used. Isn't the five lemma true in the category of groups? according to this seems true.


*Why the definition of $g$ is the correct one? (Is it continuos?) By the definition it seems the identity on the interior part of the disk, but I thought we wanted to attach $\varphi(\mathbb{S}^{n-1})$ to $A$ in a way that  the interior part doesn't lay in $A$, something like a hat, with the interior part that pops out of A, how to deal with this geometrical intuition?.


*I'd like to prove rigorously that $\pi_{n-1}(X,A)=0$ but I'm unable to do so.
Any help or reference would be appreciated.
 A: *

*I am not sure what advantage does such a choice will give, and maybe someone with more expertise can provide the answer. Maybe the point is that when you consider element in homotopy groups upto $\pi_1(A)$-action then there one can ignore the base points. See Corollary 4.17 in Lecture 4 of a course taught by  Ieke Moerdijk and Javier J. Gutiérrez in Fall, 2014. Here is the link to the lecture notes : https://www.math.ru.nl/~gutierrez/algtop2014.htm.


*I think the target of the map $g$ must be $A \cup_{\varphi} \mathbb{D}^n$. The relevance of the map $g$ is that it allows us to define the CW complex $A \cup_{\varphi} \mathbb{D}^n$. Now, the map $g$ is continuous and identity on the interior and the boundary is attached to $A$ via $\varphi$. This seems to agree with the geoemtric intuition of capping a $n-1$ homotopy class.


*Notation : $X = A\cup_{\varphi} \mathbb{D}^n$. Let us first see that $\pi_{n-1}(X, A) = 0$ where $\varphi : S^{n-1} \rightarrow A$ is a continuous map. Consider the following long exact sequence
$$
\pi_n(X, A) \rightarrow \pi_{n-1}(A) \rightarrow \pi_{n-1}(X) \rightarrow \pi_{n-1}(X, A) \rightarrow \pi_{n-2}(A) \rightarrow \pi_{n-2}(X)
$$
To prove the vanishing we need to know that the second arrow is surjective and the last arrow is injective. In fact both the maps are isomorphisms. Consider the following
Claim : For any CW complex $A$, let $A^i$ is the $i$-th skeleta. Then the map
$$ \pi_i(A^i) \rightarrow \pi_i(A) $$
is an isomorphism. This is exactly the content of Corollary 4.12 on page 351 in the book Algebraic topology by A. Hathcher. It is available on author's homepage : http://pi.math.cornell.edu/~hatcher/AT/ATpage.html.
Now using the claim we get that $\pi_i(A) \rightarrow \pi_i(X)$ is an isomorphism for all $i<n$ since they have the same $i$-skeleta for all $i<n$.
The situation for general $X$ is no different since any $X$ is built out of attaching one cell at a time and the homotopy groups commute with filtered colimits of CW complexes in which all the maps are inclusions. For example see Corollary 12.3 in Haynes Miller. 18.906 Algebraic Topology II. Spring 2020. Massachusetts Institute of Technology: MIT OpenCourseWare, https://ocw.mit.edu.
Here is the link to the pdf file of the course by Prof. Miller : https://ocw.mit.edu/courses/mathematics/18-906-algebraic-topology-ii-spring-2020/lecture-notes/MIT18_906S20_notes.pdf
