[proofplan]
We prove the result by induction on $n$, using the Mayer--Vietoris sequence applied to the standard decomposition of $S^n$ into two contractible open sets. The base case $n = 1$ is established by the [Homology of the Circle](/theorems/2250). For the inductive step ($n \geq 2$), we cover $S^n$ by $A = S^n \setminus \{N\}$ and $B = S^n \setminus \{S\}$, both contractible, with $A \cap B \simeq S^{n-1}$. The Mayer--Vietoris sequence yields isomorphisms $H_i(S^n) \cong H_{i-1}(S^{n-1})$ for $i \geq 2$ and $H_1(S^n) = 0$ from the low-degree analysis.
[/proofplan]
[step:Verify the base case $n = 1$]
By the [Homology of the Circle](/theorems/2250):
\begin{align*}
H_i(S^1) = \begin{cases} \mathbb{Z} & i = 0, 1 \\ 0 & \text{otherwise.} \end{cases}
\end{align*}
This matches the claimed formula with $n = 1$.
[/step]
[step:Set up the Mayer--Vietoris decomposition for $S^n$ with $n \geq 2$]
Assume the result holds for $S^{n-1}$ and consider $S^n$ with $n \geq 2$. Let $N = (0, \ldots, 0, 1)$ and $S = (0, \ldots, 0, -1)$ be the north and south poles. Set
\begin{align*}
A := S^n \setminus \{N\}, \quad B := S^n \setminus \{S\}.
\end{align*}
Then $A \cup B = S^n$, and both $A$ and $B$ are contractible (each is homeomorphic to $\mathbb{R}^n$ via stereographic projection). The intersection $A \cap B = S^n \setminus \{N, S\}$ deformation retracts onto the equator $S^{n-1} \subset S^n$ (via normalised radial projection to $\{x_{n+1} = 0\}$).
The relevant homology groups are:
\begin{align*}
H_i(A) &= H_i(B) = 0 \quad \text{for } i \geq 1, \\
H_0(A) &= H_0(B) = \mathbb{Z}, \\
H_i(A \cap B) &\cong H_i(S^{n-1}) \quad \text{for all } i.
\end{align*}
[/step]
[step:Extract the isomorphism $H_i(S^n) \cong H_{i-1}(S^{n-1})$ for $i \geq 2$ from the Mayer--Vietoris sequence]
For $i \geq 2$, the Mayer--Vietoris sequence gives:
\begin{align*}
H_i(A) \oplus H_i(B) \to H_i(S^n) \xrightarrow{\partial} H_{i-1}(A \cap B) \to H_{i-1}(A) \oplus H_{i-1}(B).
\end{align*}
Since $H_i(A) = H_i(B) = 0$ and $H_{i-1}(A) = H_{i-1}(B) = 0$ (because $i - 1 \geq 1$ and $A, B$ are contractible), this simplifies to:
\begin{align*}
0 \to H_i(S^n) \xrightarrow{\partial} H_{i-1}(A \cap B) \to 0.
\end{align*}
By exactness, $\partial$ is an isomorphism. Since $H_{i-1}(A \cap B) \cong H_{i-1}(S^{n-1})$:
\begin{align*}
H_i(S^n) \cong H_{i-1}(S^{n-1}) \quad \text{for all } i \geq 2.
\end{align*}
Applying the inductive hypothesis: $H_{i-1}(S^{n-1}) \cong \mathbb{Z}$ when $i - 1 = n - 1$ (i.e., $i = n$), and $H_{i-1}(S^{n-1}) = 0$ for all other $i - 1$ with $1 \leq i - 1 \leq n - 2$ (i.e., $2 \leq i \leq n - 1$) and $i - 1 > n - 1$ (i.e., $i > n$). Therefore:
\begin{align*}
H_i(S^n) = \begin{cases} \mathbb{Z} & i = n \\ 0 & 2 \leq i \neq n. \end{cases}
\end{align*}
[/step]
[step:Show $H_1(S^n) = 0$ and $H_0(S^n) \cong \mathbb{Z}$ for $n \geq 2$]
The low-degree portion of the Mayer--Vietoris sequence reads:
\begin{align*}
0 = H_1(A) \oplus H_1(B) \to H_1(S^n) \xrightarrow{\partial} H_0(A \cap B) \xrightarrow{i_{A*} \oplus i_{B*}} H_0(A) \oplus H_0(B) \to H_0(S^n) \to 0.
\end{align*}
Since $n \geq 2$, the intersection $A \cap B \simeq S^{n-1}$ is path-connected ($S^{n-1}$ is path-connected for $n - 1 \geq 1$). Therefore $H_0(A \cap B) \cong \mathbb{Z}$, generated by the class of any point $[p]$.
The map $i_{A*} \oplus i_{B*}: \mathbb{Z} \to \mathbb{Z} \oplus \mathbb{Z}$ sends $[p]$ to $([p], [p])$, i.e., $1 \mapsto (1, 1)$, which is injective.
By exactness at $H_0(A \cap B)$: $\operatorname{im}(\partial) = \ker(i_{A*} \oplus i_{B*}) = 0$, so $\partial = 0$. By exactness at $H_1(S^n)$: $\ker(\partial) = H_1(S^n)$ (since the map from $H_1(A) \oplus H_1(B) = 0$ has trivial image). Since $\partial$ is both injective (trivial preceding term) and zero, $H_1(S^n) = 0$.
For $H_0$: since $S^n$ is path-connected for $n \geq 1$, $H_0(S^n) \cong \mathbb{Z}$.
[guided]
The path-connectedness of $A \cap B$ is the crucial difference from the $n = 1$ case. For $S^1$, the intersection $A \cap B$ has two path components, giving $H_0(A \cap B) \cong \mathbb{Z}^2$, and the map $i_{A*} \oplus i_{B*}: \mathbb{Z}^2 \to \mathbb{Z}^2$ has a nontrivial kernel $\mathbb{Z} \cdot (1, -1)$. This kernel is the image of $\partial$ and produces $H_1(S^1) \cong \mathbb{Z}$.
For $n \geq 2$, the intersection $A \cap B \simeq S^{n-1}$ is path-connected, so $H_0(A \cap B) \cong \mathbb{Z}$. The map $1 \mapsto (1, 1)$ is injective, giving $\ker(i_{A*} \oplus i_{B*}) = 0$. Exactness then forces $\operatorname{im}(\partial) = 0$, and injectivity of $\partial$ (from the vanishing of the preceding term) forces $H_1(S^n) = 0$.
In summary: the first homology of $S^n$ for $n \geq 2$ vanishes because $S^{n-1}$ is connected, while $H_1(S^1) \cong \mathbb{Z}$ because $S^0$ is disconnected.
[/guided]
[/step]
[step:Assemble the complete computation]
Combining all the results for $n \geq 2$:
\begin{align*}
H_i(S^n) = \begin{cases} \mathbb{Z} & i = 0 \\ 0 & 1 \leq i \leq n - 1 \\ \mathbb{Z} & i = n \\ 0 & i > n. \end{cases}
\end{align*}
Together with the base case $n = 1$, the formula $H_i(S^n) \cong \mathbb{Z}$ for $i \in \{0, n\}$ and $H_i(S^n) = 0$ otherwise holds for all $n \geq 1$.
[/step]