Build an example of a topological space $A$ such that $$H_n(A;\mathbb{Z})= \begin{cases} \mathbb{Z} & \text{ if } n=0 \\ \mathbb{Z}/2 & \text{ if } n=4 \\ 0 & \text{ otherwise} \end{cases}.$$
Since $H_0(A)=\mathbb{Z}$ then $A$ has to be arc-connected, I've thought about using Mayer Vietoris's succession to build this example $$...\to H_4(U\cap V)\to H_4(U)\oplus H_4(V)\to H_4(A)\to H_3(U\cap V)\to H_3(U)\oplus H_3(V)\to...$$ but I do not know how to take $U\subset A$ and $V\subset A$ or how can I do this, any ideas? Thank you.
Since $H_0(\Bbb R\Bbb P^2;\Bbb Z)=\Bbb Z$ and $H_1(\Bbb R\Bbb P^2;\Bbb Z)=\Bbb Z/2\Bbb Z$ you can just suspend this space a few times.
More generally suppose $G=\langle R | S\rangle$ is a group presentation for an Abelian $G$, you can build a $2$-dimensional connected CW-complex $X$ with $H_1(X;\Bbb Z)=G$ by picking a wedge of as many $S^1$ as elements of $R$, orienting each circle, and attaching one $2$-cell for every relation in $S$, "along the relation".
Suspending such a space gives a space with only one nontrivial prescribed homology group, and wedging together many such spaces is a way to build a space with prescribed homology in every dimension.