A surface of genus g is not homotopy equivalent to a wedge sum of CW-complexes

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.

• Welcome to MSE. Nice first question! – José Carlos Santos Feb 18 '18 at 10:34
• First of all, what you managed to prove is not quite right, it is true only if $g>0$. Second, what can you say about the fundamental groups of $X$ and $Y$? – Moishe Kohan Feb 18 '18 at 14:01
• @MoisheCohen: Actually, it is correct regardless of genus, when you add the assumption that $\alpha\neq 0$ (and that assumption is necessary regardless of the genus). – Eric Wofsey Feb 18 '18 at 16:32

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})$?
Let $i:X\to Z$ and $j:Y\to Z$ be the inclusion maps. Note that $i^*(\alpha\beta)=0$ since $H^2(X;\mathbb{Z})=0$ and $j^*(\alpha\beta)=0$ since $j^*(\alpha)=0$. Since $(i^*,j^*):H^2(Z;\mathbb{Z})\to H^2(X;\mathbb{Z})\times H^2(Y;\mathbb{Z})$ is an isomorphism, this means $\alpha\beta=0$.