I am reading through Glen Bredon's book "Geometry and Topology" and after giving the axioms for Steenrod squares plus the Adem relation, he proves that if $i$ is not a power of $2$ then $Sq^i$ is equal to the sum of a composition of Steenrod squares of smaller degree than $i$ (and in particular powers of $2$). To give applications of Steenrod squares, Bredon states the following:
If $M^{2n}$ is a closed $2n$-manifold with $H_i(M,\mathbb{Z}/2) = 0$ for $0<i<n$ and with $H_n(M;\mathbb{Z}/2) \cong\mathbb{Z}/2$, then $n$ is a power of $2$.
I can see how this would follow if we can show that for the nontrivial element $x \in H^n(M, \mathbb{Z}/2)$, then $x^2 \neq 0$. Is this true?
Additionally, with one more line Bredon goes on to show that if we have a sphere bundle $f : S^{2n-1} \to S^n$, then $n$ is a power of $2$. Bredon says that this follows from the previous claim after noting that the mapping cylinder $M(f)$ is a manifold and then so is the mapping cone $C(f)$. He then notes that $C(f)$ satisfies the above homological requirements. I was not sure how to see that $M(f)$ is a manifold? Is this a general fact about mapping cylinders of fiber bundles?
Let $x$ be the non-zero element of $H^n(M, \mathbb{Z}/2)$.
Consider the linear map $L : H^n(M, \mathbb{Z}/2) \to \mathbb{Z}/2$ given by $y \mapsto \langle x\cup y, [M]\rangle$ where $[M]$ denotes the fundamental homology class (if $M$ is connected, this is the unique non-zero element of $H_{2n}(M, \mathbb{Z}/2)$). Then $L = 0$ if and only if $x \cup x = 0$, but by Poincaré duality $L \neq 0$ so $x\cup x \neq 0$.
If $n$ is not a power of $2$, then $\operatorname{Sq}^n$ can be written as a sum of compositions of Steenrod operations of smaller degree than $n$. But note that for $i < n$,
$$\operatorname{Sq}^i : H^n(M, \mathbb{Z}/2) \to H^{n+i}(M, \mathbb{Z}/2) \cong H_{n-i}(M, \mathbb{Z}/2) = 0$$
so $\operatorname{Sq}^n : H^n(M, \mathbb{Z}/2) \to H^{2n}(M, \mathbb{Z}/2)$ must be the zero map. As $\operatorname{Sq}^n(x) = x\cup x \neq 0$, we see that $n$ must be a power of $2$.