Example $4.8$ - Chapter $0$ - Do Carmo's Riemannian Geometry I have some doubts about the proof in example $4.8$ in chapter $0$ of Do Carmo's Riemannian Geometry book concerning to the part of the proof that the canonical projection of a differentiable manifold $M$ in it's quotient space $M/G$ given by the relation defined by an properly discontinuous action is a local diffeomorphism. Precisely, I didn't understand the following statement:

Let $p_1 = (\pi_1^{-1} \circ \pi_2) (p_2)$. Then $p_1$ and $p_2$ are equivalent in $M$, hence there is a a $g \in G$ such that $gp_2 = p_1$. It follows easily that  the restriction $(\pi_1^{-1} \circ \pi_2)|_{\textbf{x}_2(W)}$ coincides with the diffeomorphism $\varphi_g|_{\textbf{x}_2(W)}$.

Why $(\pi_1^{-1} \circ \pi_2)|_{\textbf{x}_2(W)}$ coincides with the diffeomorphism $\varphi_g|_{\textbf{x}_2(W)}$? How the fact that the action is properly discontinuous is used here to ensure that the functions coincide on $\textbf{x}_2(W)$? Is $G$ the group of $\textbf{all}$ diffeomorphisms of $M$ or just a group of a $\textbf{specific}$ diffeomorphisms of $M$?
About my last question, I think $G$ is the group of $\textbf{all}$ diffeomorphisms of $M$, because he stated that $p_1$ and $p_2$ are equivalent.
Below, there is the example $4.8$.

$4.8$ Example. ($\textit{Discontinuous action of a group}$). We say that a group $G$ acts on a differentiable manifold $M$ if there exists a mapping $\varphi: G \times M \rightarrow M$ such that
(i) For each $g \in G$, the mapping $\varphi_g: M \longrightarrow M$ given by $\varphi_g(p) = \varphi(g,p)$, $p \in M$, is a diffeomorphism and $\varphi_e = \text{identity}$.
(ii) If $g_1, g_2 \in G$, $\varphi_{g_1g_2} = \varphi_{g_1} \circ \varphi_{g_2}$.
Frequently, when dealing with a single action, we set $\varphi(g,p) = gp$; in this notation, condition $(ii)$ can be interpreted as a formof associativity: $(g_1g_2)p = g_1(g_2p)$.
We say that the action is $\textit{properly discontinuous}$ if every $p \in M$ has a neighborhood $U \subset M$ such that $U \cap g(U) = \emptyset$ for all $g \neq e$.
When $G$ acts on $M$, the action determines an equivalence relation $\sim$ on $M$, in which $p_1 \sim p_2$ if and only if $p_2 = gp_1$, for some $g \in G$. Denote the quotient space of $M$ by this equivalence relation by $M / G$. The mapping $\pi: M \longrightarrow M/G$, given by
$$\pi(p) = \text{equiv. class of} \ p = Gp$$
will be called the $\textit{projection}$ of $M$ onto $M/G$.
Now let $M$ be a differentiable manifold and let $\varphi: G \times M \longrightarrow M$ be a properly discontinuous action of a group $G$ on $M$. We are going to show that $M/G$ has a differentiable structure with respect to which the projection $\pi: M \longrightarrow M/G$ is a local diffeomorphism.
For each $p \in M$ choose a parametrization $\textbf{x}: V \longrightarrow M$ at $p$ so that $\textbf{x}(V) \subset U$, where $U \subset M$ is a neighborhood og $p$ such that $U \cap gU = \emptyset$, $g \neq e$. Clearly $\pi|_U$ is injective, hence $\textbf{y} = \pi \circ \textbf{x}: V \longrightarrow M/G$ is injective. The family $\{ (V,\textbf{y}) \}$ clearly covers $M/G$; for such a family to be a differentiable structure, it suffices to show that given two mappings $\textbf{y}_1 = \pi \circ \textbf{x}_1: V_1 \longrightarrow M/G$ and $\textbf{y}_2 = \pi \circ \textbf{x}_2: V_2 \longrightarrow M/G$ with $\textbf{y}_1(V_1) \cap \textbf{y}_2(V_2) \neq \emptyset$, then $\textbf{y}_1^{-1} \circ \textbf{y}_2$ is differentiable.
For this, let $\pi_i$ be the restriction of $\pi$ to $\textbf{x}_i(V_i)$, $i = 1,2$. Let $q \in \textbf{y}_1(V_1) \cap \textbf{y}_2(V_2)$ and let $\textbf{r} = \textbf{x}_2^{-1} \circ \pi_2^{-1}(q)$. Let $W \subset V_2$ be a neighborhood of $\textbf{r}$ such that $(\pi_2 \circ \textbf{x}_2)(W) \subset \textbf{y}_1(V_1) \cap \textbf{y}_2(V_2)$. Then, the rstriction to $W$ is given by
$$\textbf{y}_1^{-1} \circ \textbf{y}_2|_W = \textbf{x}_1^{-1} \circ \pi_1^{-1} \circ \pi_2 \circ \textbf{x}_2.$$
Therefore, it is enough to show that $\pi_1^{-1} \circ \pi_2$ is differentiable at $p_2 = \pi_2^{-1}(q)$. Let $p_1 = \pi_1^{-1} \circ \pi_2 (p_2)$. Then $p_1$ and $p_2$ are equivalent in $M$, hence there is a $g \in G$ such that $gp_2 = p_1$ . It follows easily that the restrinction $\pi_1^{-1} \circ \pi_2|_{\textbf{x}_2(W)}$ coincides with the diffeomorphism $\varphi_g|_{\textbf{x}_2(W)}$, which proves that $\pi_1^{-1} \circ \pi_2$ is differentiable at $p_2$, as stated.

Thanks in advance!
$\textbf{EDIT:}$
I think that I finally understood the confusion that I did in the comments of Paul's answer, I thought that $\pi(gp) = \pi(p)$ because $gp = p$, but is not it. I will comment why $\pi(gp) = \pi(p)$ just for future reference if I forget this. Remember that

$$\pi(p) = \text{equiv. class of} \ p = Gp$$

In other words,
$$\pi(p) = \text{equiv. class of} \ p = Gp = \{ gp \ ; \ g \in G \}.$$
This implies that $p, gp \in Gp$ because $p = ep$ and $e, g \in G$, i.e.,
$$\pi(p) = \text{equiv. class of} \ p = \text{equiv. class of} \ gp = \pi(gp).$$
 A: $G$ is any group acting by diffeomorphisms on $M$. The points $p_1, p_2$ are equivalent simply because both are mapped by $\pi$ to $q \in M/G$.
The claim that $(\pi_1^{-1} \circ \pi_2)|_{\textbf{x}_2(W)} = \varphi_g|_{\textbf{x}_2(W)}$ is potentially false for the set $W$ considered by do Carmo. However, it is true if $W$ is chosen carefully.
Given $q \in \textbf{y}_1(V_1) \cap \textbf{y}_2(V_2)$, let $p_i = \pi_i^{-1}(q) \in \textbf{x}_i(V_i)$. Since $\pi(p_i) = q$, these two points are equivalent which means that there exists $g \in G$ such that $gp_2 = p_1$. Choose a neighborhood $U_2$ of $p_2$ in $M$ such that $\varphi_g(U_2) \subset \textbf{x}_1(V_1)$ and let $V'_2 = \textbf{x}_2^{-1}(U_2)$ which is an open subset of $V_2$ containing $\textbf{r} = \textbf{x}_2^{-1}(p_2)$. Now let $W \subset V'_2$ be an open neighborhood of $\textbf{r}$ such that $(\pi_2 \circ \textbf{x}_2)(W) \subset \textbf{y}_1(V_1) \cap \textbf{y}_2(V_2)$.
Then $(\pi_1^{-1} \circ \pi_2)|_{\textbf{x}_2(W)} = \varphi_g|_{\textbf{x}_2(W)}$ is equivalent to $\pi_2|_{\textbf{x}_2(W)} = \pi_1 \circ \varphi_g|_{\textbf{x}_2(W)}$. Note that the composition on the right hand side makes sense because we constructed $W$ such that $\varphi_g(\textbf{x}_2(W)) \subset \varphi_g(\textbf{x}_2(V'_2)) = \varphi_g(U_2) \subset \textbf{x}_1(V_1)$.
But now we have for $p \in \textbf{x}_2(W)$
$$(\pi_1 \circ \varphi_g)(p) = \pi(gp) = \pi(p) = \pi_2(p) .$$
