Suppose we have two maps $f,g: S^1 \to S^1$ with $f(z) = z^p$, and $g(z) = z^q$ for two primes $p \neq q$. Consider the space $M$ formed by gluing together two copies of $D^2$ to a single $S^1$ along its boundary, according to the maps $f,g$. Here's a crude picture of what I mean:
I want to show that $M$ is homotopy equivalent to the sphere $S^2$. How can I go about doing it?
Intuitively I can sort of see what's happening. On the left side, we're identifying points along a $p$-gon around the border of the disk, and on the right, we're doing the same for a $q$-gon. When we're gluing them together, since $(p,q) = 1$, I can see how everything gets identified to itself, and results in a $pq$-times folded circle $S^1$. But this is not at all a formal solution, and I don't even know if it's correct (because it's not a formal solution).