I want to show that $\mathbb{R}P^{n-1}$ is not a retract of $\mathbb{R}P^n$ for $n \geq 2$ using the cup product.
Proposed solution:
Suppose on the contrary that that $\iota: \mathbb{R}P^{n-1} \hookrightarrow \mathbb{R}P^{n}$ is a retract for $n\geq2$. This implies the existence of a retraction $$ r: \mathbb{R}P^{n} \rightarrow \mathbb{R}P^{n-1} $$ such that $r\iota = id_{\mathbb{R}P^{n-1}}$. Applying the mod 2 cohomology functor yields $$ H^*(\iota;\mathbb{F}_2) \circ H^*(r;\mathbb{F}_2) = id_{\mathbb{F}_2} $$ This implies that $r^* \triangleq H^*(r;\mathbb{F}_2)$ is a non trivial homomorphism. We have $H^*(\mathbb{R}P^{n-1};\mathbb{F}_2) \cong \mathbb{F}_2[x]/(x^n)$ and $H^*(\mathbb{R}P^{n};\mathbb{F}_2) \cong \mathbb{F}_2[y]/(y^{n+1})$ both generators are of degree $1$. Consider $r^*$ applied to $x^n$ $$ 0 = r^*(x^n) = (r^*(x))^n = y^n \neq 0 $$ The above yields a contradiction.
I would like some input on if this is correct. Lastly is there some other way to show this result using the cup product more explicitly?