TITLE: What is the homology groups of the torus with a sphere inside?
QUESTION [5 upvotes]: I'm trying to find the homology groups of this space X below.
The easiest part is $H_0(X)=\mathbb Z$, because $X$ is connected.
In order to find $H_1(X)$ I think the easiest method is finding its fundamental group, but I don't know the fundamental group of this space, it's my first problem.
My second problem is to find $H_2(X)$, I don't know how to triangulate this picture and I don't know how to use Mayer-Vietoris in this case. 

I really need help here, any help or comment would be appreciated.
Thanks a lot

REPLY [5 votes]: $H_0(X) = \mathbb{Z}$ since it's connected.
$H_2(X) = \mathbb{Z}^2$ since there are two non-contractable spheres
$H_1(X) = \mathbb{Z}$ since the torus has two non-contractible curves, but now one can be contracted along the sphere.

Let $a$ be the torus, and $b\cup b' = S^2$ be the upper and lower hemispheres.
$\partial a = a_1 + a_2 - a_1 - a_2 = 0$
Let $a_1 = \mathbb{T}^2 \cap  S^2$ be the meridian of the sphere (as well as the torus)
$\partial b = a_1 =\partial b'$
Let $a_{12}$ be a point of $a_1 =\mathrm{torus}\cap \mathrm{sphere}$:
$\partial a_1 = \partial a_2 = \partial b_1 =a_{12} - a_{12}=0$ 

$H_0 = \ker\partial / \mathrm{im} \,\partial = \mathrm{span}\langle a_{12}\rangle = \mathbb{Z}$
$H_1 = \ker\partial / \mathrm{im} \,\partial = \mathrm{span}\langle a_1, a_2\rangle /
\mathrm{span}\langle a_1\rangle = \mathbb{Z}$
$H_2 = \ker\partial  = \mathrm{span}\langle a,b-b'\rangle = \mathbb{Z}^2$

You may also observe the meridian circle $\mathrm{sphere} \cap \mathrm{torus}$ is contractible to a point.  
In Hatcher Chapter 0, example 0.8 (page 12) shows us the sphere with two points identified is the homotopy equivalent to the wedge of a sphere and a circle.
$$ S^2 \simeq S^2 \vee S^1$$
For your example, $ \mathbb{T}^2 \cup_{S^1} S^2 \simeq S^2 \vee S^2 \vee S^1$.  
Their homology groups will also be the same.  $H_0 = \mathbb{Z}, H_1 = \mathbb{Z}, H_2 = \mathbb{Z}^2$.