[proofplan]
We prove the homology statement: when $H_n(X; R)$ is a free $R$-module for all $n$, the natural map $H_n(X; R) \otimes_R M \to H_n(X; M)$ is an isomorphism. The strategy has three stages: (1) split the chain complex $C_n(X; R)$ as a direct sum $Z_n \oplus B_{n-1}$ using the freeness of $B_{n-1}$ over the PID $R$; (2) tensor with $M$ and exploit the splitting to reduce the computation of $H_n(X; M)$ to the cokernel of $B_n \otimes M \to Z_n \otimes M$; (3) use the freeness of $H_n(X; R) = Z_n/B_n$ to identify this cokernel with $H_n(X; R) \otimes_R M$. The cohomology statement $H^n(X; M) \cong \operatorname{Hom}_R(H_n(X; R), M)$ follows by applying $\operatorname{Hom}_R(\cdot, M)$ in place of $\cdot \otimes_R M$.
[/proofplan]
[step:Split $C_n$ as $Z_n \oplus B_{n-1}$ using the PID hypothesis]
Write $C_n = C_n(X; R)$ for the singular chain groups, $Z_n = \ker(d_n: C_n \to C_{n-1})$ for the cycles, and $B_n = \operatorname{im}(d_{n+1}: C_{n+1} \to C_n)$ for the boundaries. The differential gives a surjection
\begin{align*}
g: C_n \to B_{n-1}, \quad g(c) = d_n(c),
\end{align*}
with $\ker(g) = Z_n$, yielding the short exact sequence
\begin{align*}
0 \to Z_n \xrightarrow{i} C_n \xrightarrow{g} B_{n-1} \to 0.
\end{align*}
Since $R$ is a PID and $C_{n-1}$ is a free $R$-module (it is the free module on singular $(n-1)$-simplices), every submodule of $C_{n-1}$ is free. In particular, $B_{n-1} \subseteq C_{n-1}$ is a free $R$-module. A free module is projective, so the surjection $g: C_n \to B_{n-1}$ splits: there exists an $R$-module homomorphism $s: B_{n-1} \to C_n$ with $g \circ s = \operatorname{id}_{B_{n-1}}$. This gives a direct sum decomposition
\begin{align*}
C_n \cong Z_n \oplus B_{n-1}
\end{align*}
via the isomorphism $c \mapsto (c - s(g(c)), g(c))$.
[guided]
The splitting step is the heart of the proof, and it is where the PID hypothesis is consumed. Over a general ring, a submodule of a free module need not be free (e.g., the ideal $(2, x) \subseteq \mathbb{Z}[x]$ is a submodule of the free $\mathbb{Z}[x]$-module $\mathbb{Z}[x]$ but is not free). When $B_{n-1}$ fails to be free, the short exact sequence need not split, and the tensor product $\cdot \otimes_R M$ applied to the sequence may fail to be exact. This failure of exactness is measured by $\operatorname{Tor}^R_1(B_{n-1}, M)$, which gives rise to the correction term in the full universal coefficients theorem.
The freeness of $B_{n-1}$ is guaranteed by the structure theorem for modules over a PID: every submodule of a free module over a PID is free. For $R = \mathbb{Z}$, this is the fact that subgroups of free abelian groups are free abelian.
[/guided]
[/step]
[step:Tensor with $M$ and compute $H_n(X; M)$ via the split sequence]
Tensoring the split short exact sequence with $M$ over $R$ preserves exactness (since the sequence splits, tensoring preserves it even though $\cdot \otimes_R M$ is only right exact in general):
\begin{align*}
0 \to Z_n \otimes_R M \xrightarrow{i \otimes \operatorname{id}} C_n \otimes_R M \xrightarrow{g \otimes \operatorname{id}} B_{n-1} \otimes_R M \to 0.
\end{align*}
The chain complex $C_\bullet(X; M) = C_\bullet(X; R) \otimes_R M$ has differential $d \otimes \operatorname{id}_M$. By definition, $H_n(X; M) = \ker(d_n \otimes \operatorname{id}_M) / \operatorname{im}(d_{n+1} \otimes \operatorname{id}_M)$.
Under the splitting $C_n \otimes M \cong (Z_n \otimes M) \oplus (B_{n-1} \otimes M)$, the differential $d_n \otimes \operatorname{id}$ maps $C_n \otimes M$ to $C_{n-1} \otimes M$ by sending $(z \otimes m, b \otimes m')$ to $(d_n(z) \otimes m + d_n(s(b)) \otimes m', \ldots)$. Since $z \in Z_n$ gives $d_n(z) = 0$, and $d_n \circ s: B_{n-1} \to B_{n-2} \subseteq Z_{n-2}$ (using $d \circ d = 0$), we see:
\begin{align*}
\ker(d_n \otimes \operatorname{id}) &= Z_n \otimes M, \\
\operatorname{im}(d_{n+1} \otimes \operatorname{id}) &= B_n \otimes M \subseteq Z_n \otimes M.
\end{align*}
Therefore
\begin{align*}
H_n(X; M) = \frac{Z_n \otimes_R M}{B_n \otimes_R M}.
\end{align*}
[guided]
Why is $\ker(d_n \otimes \operatorname{id}) = Z_n \otimes M$? Under the decomposition $C_n \otimes M = (Z_n \otimes M) \oplus (B_{n-1} \otimes M)$, an element of $C_n \otimes M$ lies in the kernel of $d_n \otimes \operatorname{id}$ precisely when its $B_{n-1} \otimes M$ component maps to zero under $d_n \otimes \operatorname{id}$. But $d_n$ restricted to $s(B_{n-1})$ equals $d_n \circ s$, and $g \circ s = \operatorname{id}$ means $s$ is injective. The map $d_n|_{s(B_{n-1})}$ factors through $C_{n-1}$ and its composition with $g$ is $d_{n-1} \circ d_n \circ s = 0$ (but $d_n \circ s$ itself is the inclusion of $B_{n-1}$ into $C_{n-1}$, which need not be zero). More carefully: an element $s(b) \otimes m$ with $b \neq 0$ satisfies $d_n(s(b)) \otimes m = b \otimes m$ viewed in $C_{n-1} \otimes M$ (since $g(s(b)) = b$, but $d_n(s(b))$ has a $Z_{n-1}$ component as well). So the kernel is exactly $Z_n \otimes M$.
Similarly, $\operatorname{im}(d_{n+1} \otimes \operatorname{id})$: a typical element is $d_{n+1}(c) \otimes m$ for $c \in C_{n+1}$. Since $d_{n+1}(c) \in B_n \subseteq Z_n$, this lies in $Z_n \otimes M$, and by surjectivity of $d_{n+1}$ onto $B_n$, the image is all of $B_n \otimes M$.
[/guided]
[/step]
[step:Use freeness of $H_n(X; R)$ to identify the quotient with $H_n(X; R) \otimes_R M$]
The short exact sequence defining homology is
\begin{align*}
0 \to B_n \xrightarrow{j} Z_n \xrightarrow{\pi} H_n(X; R) \to 0,
\end{align*}
where $j$ is the inclusion and $\pi$ is the quotient map. Since $H_n(X; R)$ is free by hypothesis, this sequence splits: there exists $t: H_n(X; R) \to Z_n$ with $\pi \circ t = \operatorname{id}_{H_n(X;R)}$, giving $Z_n \cong B_n \oplus H_n(X; R)$.
Tensoring with $M$ preserves the split exact sequence:
\begin{align*}
0 \to B_n \otimes_R M \xrightarrow{j \otimes \operatorname{id}} Z_n \otimes_R M \xrightarrow{\pi \otimes \operatorname{id}} H_n(X; R) \otimes_R M \to 0.
\end{align*}
In particular, $\pi \otimes \operatorname{id}$ is surjective with kernel $B_n \otimes_R M$. Therefore
\begin{align*}
\frac{Z_n \otimes_R M}{B_n \otimes_R M} \cong H_n(X; R) \otimes_R M.
\end{align*}
Combining with the previous step, $H_n(X; M) \cong H_n(X; R) \otimes_R M$.
[/step]
[step:Prove the cohomology statement by applying $\operatorname{Hom}_R(\cdot, M)$]
We apply $\operatorname{Hom}_R(\cdot, M)$ instead of $\cdot \otimes_R M$. Since $B_{n-1}$ is free (hence projective), the short exact sequence $0 \to Z_n \to C_n \to B_{n-1} \to 0$ splits, and applying $\operatorname{Hom}_R(\cdot, M)$ yields the exact sequence
\begin{align*}
0 \to \operatorname{Hom}_R(B_{n-1}, M) \to \operatorname{Hom}_R(C_n, M) \to \operatorname{Hom}_R(Z_n, M) \to 0.
\end{align*}
The cochain complex $C^n(X; M) = \operatorname{Hom}_R(C_n, M)$ has cohomology $H^n(X; M) = \ker(d^n) / \operatorname{im}(d^{n-1})$. By the same splitting argument, $\ker(d^n) = \operatorname{Hom}_R(Z_n, M)$ and $\operatorname{im}(d^{n-1}) = \operatorname{Hom}_R(Z_n, M) \cap \{f : f|_{B_n} = 0\}^\perp$. More precisely, the image consists of those homomorphisms $Z_n \to M$ that factor through $Z_n/B_n$.
Since $H_n(X; R) = Z_n / B_n$ is free, the sequence $0 \to B_n \to Z_n \to H_n(X;R) \to 0$ splits, and applying $\operatorname{Hom}_R(\cdot, M)$:
\begin{align*}
0 \to \operatorname{Hom}_R(H_n(X;R), M) \to \operatorname{Hom}_R(Z_n, M) \to \operatorname{Hom}_R(B_n, M) \to 0.
\end{align*}
By the same analysis as the homology case, $H^n(X; M) \cong \operatorname{Hom}_R(Z_n, M) / \operatorname{Hom}_R(B_n, M)' \cong \operatorname{Hom}_R(H_n(X;R), M)$, where the quotient identifies homomorphisms $Z_n \to M$ that agree on $B_n$ with homomorphisms $H_n(X;R) \to M$.
More directly: the restriction map $\operatorname{Hom}_R(Z_n, M) \to \operatorname{Hom}_R(B_n, M)$ is surjective (by the splitting), so its kernel is exactly $\operatorname{Hom}_R(Z_n/B_n, M) = \operatorname{Hom}_R(H_n(X;R), M)$. Since $\operatorname{im}(d^{n-1})$ corresponds to the image of $\operatorname{Hom}_R(B_n, M)$ in $\operatorname{Hom}_R(Z_n, M)$ (via the splitting), we get
\begin{align*}
H^n(X; M) \cong \operatorname{Hom}_R(H_n(X; R), M).
\end{align*}
[/step]
[step:State the naturality of both isomorphisms]
Both isomorphisms are natural in $X$ and $M$. For a continuous map $f: X \to Y$, the induced chain map $f_\#: C_\bullet(X; R) \to C_\bullet(Y; R)$ respects cycles, boundaries, and the splittings, so the isomorphisms commute with $f_*$ (for homology) and $f^*$ (for cohomology). For an $R$-module map $g: M \to M'$, tensoring with $g$ (or composing with $g$) commutes with the isomorphism at each stage. This naturality is what makes the universal coefficients theorem a statement about natural transformations, not merely about individual isomorphisms.
[/step]