Why these two spaces are homotopically equivalent? Let us define $X=\{(x,y) \in \mathbb{R}^2: (x-1)^2+y^2=1 \} \cup \{(x,y) \in \mathbb{R}^2: (x+1)^2+y^2=1 \} \subset \mathbb{R}^2$ and $Y=\{(x,y) \in \mathbb{R}^2: (x-2)^2+y^2=1 \} \cup \{(x,y) \in \mathbb{R}^2: (x+2)^2+y^2=1 \} \cup \{(x,y) \in \mathbb{R}^2 : y=0, -1 \leq x \leq 1\}$.
I know that $\pi_1(X,(0,0))=\mathbb{Z}*\mathbb{Z}=\pi_1(Y,(0,0))$ and that there is an identification $\pi : Y \to X$ which identificate $\{(x,y) \in \mathbb{R}^2 : y=0, -1 \leq x \leq 1\}$ into a point. But how can we construct an homotopic equivalence?
I understand that the idea is to shorten the line $\{(x,y) \in \mathbb{R}^2 : y=0, -1 \leq x \leq 1\}$ gradually but I would like to answer formally.
I found other questions about this problem but I would like to know if there is a way not using cell attachements. I am searching for explicit equivalent map.
 A: Let $B=\{(x,y)\in\Bbb{R}^2|x^2+y^2\le9\}\setminus\{(-2/3,0),(2/3,0)\}$, then we construct two deformation retractions. Well, maybe I missed something but this result is quite complicated since I used the straight line homotopy. (there's no other good way probably)


*

*we construct a deformation retraction $F:B\times I\to Y$:
$$
F((x,y),t)=
\begin{cases}
(x,(1-y)t+y) & -2/3\le x\le2/3\\
(x,t\sqrt{1-(x+2)^2}+(1-t)y)  & (x+2)^2+y^2\ge1,-3\le x\le-1\\
(x,t\sqrt{1-(x-2)^2}+(1-t)y) & (x-2)^2+y^2\ge1,1\le x\le3\\
(ta_x+(1-t)x,ta_y+(1-t)y) & \text{ otherwise}
\end{cases}
$$
where the 4th branch deals with points bounded by the two circles, so $a_x$ is the targeted point to which $x$-coordinate needs to be sent, similarly, $a_y$ represents one to which $y$-coordinate ought to be sent, where $(a_x,a_y)$ must be on one of the circles. Both of which can be solved using $(x\pm2)^2+(kx\pm3/2x)^2=1$ where $k$ is the slope.

*For $H:B\times I\to X$ we define two steps:
1) Define $G:B\times I\to X'$:
$$G((x,y),t)=
\begin{cases}
(x,y) & x^2+y^2\le4\\
t\frac{2(x,y)}{||(x,y)||}+(1-t)(x,y) & \text{ otherwise}\\
\end{cases}
$$
2) Define $K:X'\times I\to X$:
$$H((x,y),t)=
\begin{cases}
(x,t\sqrt{1-(x+1)^2}+(1-t)y) & (x+1)^2+y^2\ge1,-2\le x\le0\\
(x,t\sqrt{1-(x-1)^2}+(1-t)y) & (x-1)^2+y^2\ge1,0\le x\le2\\
(ta_x'+(1-t)x,ta_y'+(1-t)y) & \text{ otherwise}
\end{cases}
$$
where $ta_x'$ and $ta_y'$ can be obtained using a similar way as what we did in 1. Here $H=K\circ G$. Here, $G$ squeez the initial punctured disk and then $K$ uses straight line homotopy to map all points to the wedge circles.

I didn't solve for every constant in the construction (sorry for that) because we should avoid too much unnecessary calculation especially when we try to prove the existence, but I did a lot since you asked for a relatively explicit map. Actually, the following picture in Hatcher's Algebraic Topology should be able to answer your question.




Besides, the fundamental groups in your post are still incorrect. We proved that $X\simeq Y$ because they're deformation retracts of the same space. and $X\cong S^1\vee S^1\implies \pi_1(X,(0,0))\approx\Bbb{Z}*\Bbb{Z}$ by Seifert-Van Kampen's Thm. So $\pi_1(X)\approx\pi_1(Y)\approx\Bbb{Z}*\Bbb{Z}$ by homotopy equivalence.
