Solution (source code)

= Solution

A <simply connected> manifold is connected and orientable: its <orientation> character is a <group homomorphism> $\pi_1(X)\to\{\pm1\}$, and this group is trivial. Choose an <orientation>. The <Hurewicz theorem> in degree one gives $H_1(X;\mathbb Z)=0$. The <universal coefficient theorem for cohomology> then gives $H^1(X;\mathbb Z)=0$ and
$$
H^2(X;\mathbb Z)\cong\operatorname{Hom}(H_2(X;\mathbb Z),\mathbb Z),
$$
because the possible $\operatorname{Ext}(H_1(X),\mathbb Z)$ term is zero.

The <homology groups> are finitely generated for a closed manifold. The displayed dual group is therefore free abelian. <Poincare duality> identifies $H_2(X;\mathbb Z)$ with $H^2(X;\mathbb Z)$, so $H_2$ itself has no torsion. Since the second <Betti number> is one, both groups are isomorphic to $\mathbb Z$. This torsion argument is essential: rank one by itself would not rule out finite summands.

Again by <Poincare duality>, $H^3(X;\mathbb Z)\cong H_1(X;\mathbb Z)=0$, and $H^4(X;\mathbb Z)\cong H_0(X;\mathbb Z)=\mathbb Z$. Thus the only nonzero <cohomology groups> are $\mathbb Z$ in degrees $0,2,4$.

Let $u$ generate $H^2$. The integral <intersection form>
$$
Q(a,b)=\langle a\smile b,[X]\rangle
$$
is unimodular. Indeed, cap product with $[X]$ is the <Poincare duality> isomorphism to $H_2$, and the preceding universal-coefficient identification makes evaluation the full integral dual. Composing these isomorphisms identifies the pairing with an isomorphism $H^2\to\operatorname{Hom}(H^2,\mathbb Z)$. In rank one its matrix must therefore be $[1]$ or $[-1]$. Consequently $\langle u^2,[X]\rangle=\pm1$, so $u^2$ generates $H^4$.

All products in degrees above four vanish. Hence the assignment of the degree-two generator gives
$$
\boxed{H^*(X;\mathbb Z)\cong\mathbb Z[u]/(u^3),\qquad |u|=2,}
$$
which is the <cohomology ring of complex projective space> for $\mathbb{CP}^2$. If the intersection form is negative, this ring isomorphism reverses the chosen top <orientation> generator; preserving that additional <orientation> is not part of the requested ring isomorphism.