Sn has but two cells, Dn joined to a point p. The point p generates the relative homology at dimension 0. For n > 1 there is no boundary from above. Even n = 1 has a boundary of 0, as the ends of the loop cancel. Thus h0 = Z as expected.
Move to the n disk, which generates its own relative homology at dimension n. There are no higher disks, hence no boundary from above. Thus hn = Z.
The two cells of dimension 1 are loops, and hence they are cycles. With no boundary from above, h1 = Z2. Finally, h0 is generated from a single point, with no boundary from the 1 cells; hence h0 = Z. This agrees with our earlier result.
Sew the top and bottom of the square together through a reflection. Diagonalize the square as above. The boundary of the 2 cell is now twice the top loop, plus the left loop, minus the right loop. This is not 0, hence there are no two dimensional cycles, and h2 = 0. Moving to one dimension, the left and right loops are cycles, and the boundar equates one loop with another. The quotient group, which is h1, is Z. Finally h0 is the free group on two points, mod the difference between the points (via the top edge), which is Z. Sure enough, it's just like the circle.
Sew the left and right edges of the mobious strip together to get the klein bottle. The paths on the common left and right edge cancel in the boundary of the square, leaving twice the top edge. This is not 0, hence h2 = 0. Both loops are cycles, and the boundary from the square is twice the top loop, hence h1 is Z cross Z2. (This is a space whose homology is not free.) Finally, all edges are loops, and there is but one point, hence h0 = Z.
The boundary of the top is 0, because it was 0 in T2. The boundary of the bottom is also 0. For a wall, take the boundary of d applied to an interval. This expansion creates a square with the same diagonalization as the top and bottom; hence the boundary is 0. With no boundary from above, h2 is generated by the number of faces, which is 3.
Every segment connects two points that are really the same point, hence a cycle. The reduced homology is the number of distinct intervals, which is 3. Finally h0 is generated by the one and only point, and that completes the homology of T3: 1, 3, 3, 1.
Let's take the inductive step from Tn to Tn+1. Place the previous torus at the top and bottom, with a trivial homotopy in between. Let y = d applied to the base, to partition the homotopy. In any partition, one of the simplexes can be expanded to fill the volume, squashing the others into the walls. This homotopy shows our original partition y is a valid generator for the homology of the disk relative to its boundary. This becomes the generator of the homology of the n+1 skeleton relative to the n skeleton. Take the boundary of y, and top and bottom cancel, being the same face. Furthermore, every lower simplex that lives in the top is the same in the bottom, with the opposite sign, and since top and bottom are one, these simplexes cancel. Their boundaries, if any, also cancel. so all lower simplexes that appear in the top have a boundary of 0.
Let f be a face of Tn, and let d(f) form one of the walls of Tn+1. On the opposite side of the base, f appears with the opposite sign, hence d(f) appears with the opposite sign. The two walls coincide, and this portion of b(y) disappears. This happens for every wall, hence b(y) = 0, and the highest homology is Z.
Let f be any smaller simplex , with -f on the other side. This leads to d(f) and -d(f), on two sides that become one. Since these cancel, their boundaries, if any, also cancel. The boundary of every face, at every dimension, becomes 0 when walls are combined. The reduced homology is simply the number of generators. Picture the torus as the direct product of loops, where each loop is an open interval and a point. Review the construction of the direct product as a cw complex. Expand by the binomial theorem, and the reduced homology at dimension k is n choose k. (You probably recognized pascal's triangle from our 1, 3, 3, 1 example.) Again, this agrees with our earlier result.
The boundary of the loop is 0, as usual. Overlay the standard triangle on the disk, and reverse the blue arc, making it red. The boundary is now a chain of arcs that has a winding number of 2. This is twice the generator of h1 on the loop relative to its endpoint. Therefore h2 = 0, h1 = Z2, and h0 = Z. This is the first example of a space with a finite homology group.
Wrap the disk around the circle n times and h1 = Zn. A disjoint union of such spaces has, as its homology, the direct product of the individual homology groups. Therefore every finite abelian group G has a space S such that h1(S) = G. If you want S to be connected, join the 0 cells of the individual spaces together in a chain, using 1 cells. These are not cycles, and do not change h1.
Since h0 is always free on the path components of S, it cannot be a finite group.
Create RP3 by wrapping the surface of D3 twice around RP2. Let the north pole of the ball touch the south pole of RP2 and push the surface of the ball, which is a sphere, up onto the southern hemisphere. When you reach the equator, reverse course, and rotate 180 degrees, and map the southern half of the sphere onto the southern hemisphere, until the two south poles coincide. (Remember that RP2 effectively has only one hemisphere.)
Instead of one 3 dimensional simplex covering the entire ball, create an octahedron comprising 8 simplexes. The origin, at the center of the ball, is the first vertex in each simplex. The north pole is the second vertex in the four northern simplexes. The third and fourth vertices always run counterclockwise. As you remove either the third or fourth vertex, to take the boundary, the internal wall has a sign of +1 from one simplex, and -1 from the other. The internal walls go away. The southern simplexes are reflections of the northern simplexes. Subtract these, and the faces from the center to the equator go away. The boundary now lies in the surface, and we have a generator for h3. Map this boundary onto RP2, as described above. The northern faces climb up, and the southern faces climb down, with a 180 twist, and the opposite sign. Everything cancels, and the boundary is 0. The homology from 0 to 3 is Z, Z2, 0, Z.
Actually we did a lot of work for nothing. Since the only cycle at level 2 is 0, the boundary of everything at level 3 has to wind up at 0. That forces h3 = Z. But maybe it wasn't a waste of time after all, because it generalizes to higher dimensions. I'll step up to dimension 4, and you can take it from there.
An octahedron of simplexes has its boundary in the sphere. Run a fourth axis, the w axis, perpendicular to these three axes. Let w = 1 be the new north pole, and let w = -1 be the new south pole. Add the north pole to each preexisting simplex, just after the origin, to build 8 new simplexes in 4 dimensions. Retain the sign of the original simplex. Consider the boundary of this arrangement. Without the origin, the remaining faces lie in the 3 dimensional shell. Without the north pole, the remaining faces lie in w = 0, the equatorial cross section. Remove another vertex, like x = 1. Call the remaning face f. Two simplexes contain f, with x = 1 and x = -1. These come from simplexes without the north pole. Within that 3 dimensional world, the two simplexes have signs that cause the common (internal) face to go away. Therefore the two 4 dimensional simplexes containing f have signs that will cause f to go away. Reflect these simplexes through the equator, and all internal faces go away. The resulting structure has its boundary in the 3 dimensional surface of the 4 dimensional ball. Wrap this boundary up around RP3, and back down, after a 180 degree turn. Faces correspond, even after the 180 degree turn, and they have opposite signs going up and down. Our generator is a cycle, and the homology is Z. Therefore the homology of RPn is Z, Z2, 0, and Z after that, up to dimension n.