This is an exercise in 53 page of Hatcher's book :
Consider surface of $M_g$ of genus $g$
If $g=h+k$ then $$M_g = M_h'\cup_{S^1} M_k'$$
where $M_h' = M_h - D^2$
Question 1 : Then show that $M_h'$ does not retract onto $S^1$ [ Hint : Abelianize $\pi_1$]
Question 2 : And if $$M_g = \vee_{i=1}^{2g} S^1_i\cup D^2,\ S_i^1=S^1$$ then show that $M_g$ does retract onto $S^1_i$ for some $i$.
[Solution] --------------
First question may be solved :
Recall the following proposition : If $X\rightarrow A\subset X$ is a retraction then $\pi_1(A)\rightarrow \pi_1(X)$ is injective.
So if retraction in first question exists, then $\pi_1(S^1) \rightarrow \pi_1(M_g)$ is injective. Still $$\pi_1(S^1) \rightarrow \pi_1(M_g)/[\pi_1(M_g),\pi_1(M_g)]$$ is injective. But in fact the above map is zero. So there exists no retraction.