Connecting homomorphism of long exact sequence sends fundamental class to fundamental class of a boundary component I have the following homework problem.

Let $f\colon (M,\partial M)\to (M',\partial M')$ be a map between two
compact connected oriented $n$-manifolds such that $f\big|\partial M\to \partial
 M'$ is a homeomorphism. Then $\deg(f)=\pm 1$.

My idea is to use the long exact sequence of the pair $(M,\partial M)$ and $(M',\partial M')$. Since, $f\big|\partial M\to \partial M'$ is a homeomorphism $H_{n-1}(f)\colon H_{n-1}(\partial M)\to H_{n-1}(\partial M')$ is an isomorphism.
Now, if $\partial M$ is connected then $\partial M'$ is also connected and the connecting homomorphisms $\partial_n\colon H_n(M,\partial M)\to H_{n-1}(\partial M)$, $\partial_n'\colon H_n(M',\partial M')\to H_{n-1}(\partial M')$ send the fundamental classes $[M],[M']$ to the fundamental classes $[\partial M],[\partial M']$, respectively. So, $\partial_n, \partial_n'$ are isomorphisms. Finally, using naturality of connecting homomorphism we can say $H_n(f)\colon H_n(M,\partial M)\to H_n(M',\partial M')$ is an isomorphism. So, we are done in case $\partial M$ is connected.

But, I don't know how to deal with the case when $\partial M$ is not
connected.


Perhaps the point is that if we decompose the boundary into its components
$$\partial M = B_1 \cup \cdots \cup B_K
$$
then the image of the homomorphism
$$\partial_n : H_n(M,\partial M) \to H_{n-1}(\partial M) \approx H_{n-1}(B_1) \oplus \cdots \oplus H_{n-1}(B_K)
$$
is an infinite cyclic group, generated by the sum over $k$ of the fundamental class of each component $B_k$ with respect to the induced boundary orientation on $B_k$.
So in the context of your problem, $\partial_n$ and $\partial'_n$ will still be isomorphisms onto their images.
