Zeroth homology is free on set of path components

With coefficients in integers (default choice)
Suppose $$X$$ is a topological space. The zeroth homology group $$H_0(X)$$ (with coefficients in $$\mathbb{Z}$$) is a free abelian group whose rank is equal to the number of path components of $$X$$, i.e., the cardinality of the fact about::set of path components $$\pi_0(X)$$. More specifically, $$H_0(X)$$ is equipped with a natural choice of freely generating set which is in canonical bijection with $$\pi_0(X)$$.

With coefficients in an arbitrary abelian group or module
Suppose $$X$$ is a topological space and $$M$$ is an abelian group (which may be additionally interpreted as a module over a commutative unital ring $$R$$). The zeroth homology group $$H_0(X;M)$$, with coefficients in $$M$$, can be canonically identified with $$M^{\pi_0(X)}$$, i.e., a direct sum of copies of $$M$$, one copy for each path component of $$X$$. Here, $$\pi_0(X)$$ denotes the set of path components of $$X$$.

Proof for integers
Given: A topological space $$X$$.

To prove: $$H_0(X)$$ is a free abelian group with freely generating set corresponding to the elements of $$\pi_0(X)$$.

Proof: Recall that $$H_n(X) =Z_n(X)/B_n(X)$$ where $$Z_n(X)$$ and $$B_n(X)$$ are subgroups of $$C_n(X)$$ comprising the cycles and boundaries respectively, and $$C_n(X)$$ is the free abelian group on the set of singular n-simplices, which we sometimes denote by $$S_n(X)$$. Compute $$H_0(X)$$ thus boils down to unraveling the meaning of $$S_0(X), C_0(X), Z_0(X), B_0(X)$$.