I found some trouble solving an exercise from Hatcher (n. 18, p. 230). It asks to show that a closed, orientable surface $M$ of genus $g$ is not homotopy equivalent to a wedge sum of CW-complexes $X$ and $Y$ with non-trivial reduced homology.
I managed to prove that, $\forall\alpha\in H^1 (M;\mathbb Z)$, $\exists\beta\in H^1 (M;\mathbb Z)$ such that $\alpha\beta\neq 0$ in $H^2 (M;\mathbb Z)$, showing that there are two elements in the basis of the first cohomology group whose cup product calculated on a $2$-simplex is not zero.
I called $Z$ the wedge sum of $X$ and $Y$. If $Z$ was homotopy equivalent to $M$, there would be isomorphism between their respective reduced homologies, and also between their reduced cohomologies. But we also know that, $\forall i\ge 0$, $\tilde{H}^i(Z; \mathbb Z) \cong \tilde{H}^i(X; \mathbb Z) \times \tilde{H}^i(Y; \mathbb Z)$ from cohomology's axioms. Since $\tilde{H}^2(Z; \mathbb Z)\cong \tilde{H}^2(M; \mathbb Z) \cong \mathbb Z$, we can assume WLOG that $\tilde{H}^2(X; \mathbb Z)=0$.
I'd like to use the property above about the cup product and to use the fact that it induces a commutative diagram with the isomorphism induced by the homotopy equivalence and to show a contraddiction, but I think I'm missing something.
Hint: Assuming, as you have, that $H^2(X;\mathbb{Z})=0$, we must have $H^1(X;\mathbb{Z})\neq 0$ in order for $X$ to have nontrivial reduced homology. Now pick some nonzero $\alpha\in H^1(X;\mathbb{Z})$. What can you say about $\alpha\beta$ for any $\beta\in H^1(Z;\mathbb{Z})$?
More details are hidden below: