I know that the following statement is true: $H^1(X, \mathbb Z)$ is isomorphic to $\operatorname{Hom}(\pi_1(X, x_0), \mathbb Z),$ for any path-connected pointed space $(X, x_0).$
My question is what if $X$ is not path connected, would it also still be true?
Any clarification will be greatly appreciated!
Intuitively, it could not possibly be true for a non path-connected spaces in general. Notice one object possibly depends on $x_0$ (in this case) whereas the other object is invariant; it does not depend on the basepoint. Also, consider the proof that the canonical map $\pi_1(X;x_0)\to H_1(X)$ is the Abelianisation map, for path connected $X$: to demonstrate surjectivity of this map, we most certainly need the path connectivity hypothesis. If $C$ is a path component not containing $x_0$, $1$-cycles in $C$ could not possibly lie in the image of this map, not even up to boundaries, essentially because the image of any simplex is path-connected and cannot straddle both $C$ and the component containing $x_0$.
If $X$ is any path connected space with finitely generated first cohomology and $Y$ any space with nontrivial first cohomology, then $Z:=X\sqcup Y$ will be a counterexample. If $x_0\in X,\pi_1(Z;x_0)=\pi_1(X;x_0)$ has lost all information about $Y$. Try $S^1\sqcup S^1$, for instance; $\Bbb Z^2$ is not isomorphic to $\Bbb Z$.
By the way, what we really care about is not that these are isomorphic in the path-connected case but that there is a nice and very explicit natural isomorphism given by associating loops with $1$-cycles.