There are cofibration sequences
$$S^3\xrightarrow\omega S^2\vee S^2\xrightarrow{i} S^2\times S^2$$
$$S^3\xrightarrow\theta S^2\xrightarrow{j} J$$
where $\omega$ attaches the top cell of $S^2\times S^2$, the map $\theta$ is the composition $\theta=\nu\circ \omega$, with $\nu:S^2\vee S^2\rightarrow S^2$ being the fold map, $J=S^2\cup_\theta e^4$, and $i,j$ are the inclusions.
Since $\nu(\omega(x))=\theta(x)$, there is an induced map $\varphi:S^2\times S^2\rightarrow J$ which is $\nu$ on $S^2\vee S^2$ and is the identity on the points of the open 4-cell. In particular, if $p:S^2\times S^2\rightarrow S^4$ is the map collapsing the 2-skeleton to a point, then $p$ factors as the composition
$$p:S^2\times S^2\xrightarrow{\varphi}J\xrightarrow{q}S^4$$
where $q:J\rightarrow S^4$ is the corresponding collapse map on $J$.
Now turn to cohomology. I will use $H^*$ to denote reduced singular homology with integral coefficients.
The maps $\omega,\theta$ induce trivial maps in cohomology for degree reasons, and this leaves short exact sequences
$$0\leftarrow H^*(S^2\vee S^2)\xleftarrow{i^*} H^*(S^2\times S^2)\xleftarrow{p^*} H^*S^4\leftarrow 0$$
$$0\leftarrow H^*S^2\xleftarrow{j^*} H^*J\xleftarrow{q^*} H^*S^4\leftarrow 0.$$
Here we have used the fact that $H^*(J,S^2)\cong H^*(J/S^2)=H^*S^4$ naturally, and similarly $H^*(S^2\times S^2,S^2\vee S^2)\cong H^*S^4$ naturally. There is a map between these sequences (going upwards), which is $\nu^*$ on the left-hand group, $\varphi^*$ on the middle group, and the identity on $H^*S^4$.
Let $s\in H^2S^2\cong\mathbb{Z}$ and $t\in H^4S^4\cong\mathbb{Z}$ be generators. By exactness we have $H^2J\cong\mathbb{Z}$ generated by a class $x$ satisfying $j^*x=s$, and $H^4J\cong\mathbb{Z}$ generated by $y=q^*t$. Of course $H^kJ=0$ for $k\not\in\{2,4\}$. Thus the problem facing us is reduced to the computation of the integer $n\in\mathbb{Z}$ satisfying
$$x^2=n\cdot y.$$
Now, the maps
$$in_1:S^2\hookrightarrow S^2\vee S^2\hookleftarrow S^2:in_2$$
which include the two wedge summands add together to induce an isomorphism
$$H^*(S^2\vee S^2)\xrightarrow{\cong} H^*S^2\oplus H^*S^2$$
Since $\nu\circ in_1=id_{S^2}=\nu\circ in_2$, the composition of this isomorphism with $\nu^*:H^*S^2\rightarrow H^*(S^2\vee S^2)$ is exactly the map
$$a\mapsto (a,a).$$
This map is injective, so use of the Five Lemma shows that $\varphi^*:H^*J\rightarrow H^*(S^2\times S^2)$ is injective.
Next use the Kunneth formula to identify generators of $H^2(S^2\times S^2)\cong\mathbb{Z}\oplus\mathbb{Z}$ as the classes $s_1=s\otimes 1$ and $s_2=1\otimes s$. Observe that
$$i^*\varphi^*(x)=\nu^*j^*(x)=\nu^*s=(s,s).$$
Since $i^*:H^2(S^2\times S^2)\rightarrow H^2(S^2\vee S^2)\cong H^2S^2\oplus H^2S^2$ is an isomorphism we have
$$\varphi^*x=s_1+s_2.$$
From this we obtain
$$\varphi^*(x^2)=(\varphi^*x)^2=(s_1+s_2)^2=s_1^2+s_1s_2+s_2s_1+s_2^2=2s_1s_2,$$
since $s_1^2=s_2^2=0$ and the even degree classes satisfy $s_1s_2=s_2s_1$.
Now the class $s_1s_2=s\otimes s$ generates $H^4(S^2\times S^2)$, and we can assume that the generator $t\in H^4S^4$ satisfies $p^*t=s_1s_2$. Thus
$$\varphi^*y=\varphi^*q^*(t)=p^*(t)=s_1s_2.$$
Comparing this with the equation above we have
$$\varphi^*(x^2)=2s_1s_2=2\cdot \varphi^*(y)=\varphi^*(2\cdot y).$$
But $\varphi^*$ is injective, so the only way this equation can hold is if
$$x^2=2\cdot y,$$
which is exactly what was to be shown.
Incidentally, $\theta=\nu\circ\omega$ must be homotopic to a multiple of the Hopf map $\eta$ which generates $\pi_3S^2\cong\mathbb{Z}$. Our computation above verifies that $\theta\simeq\pm 2\cdot\eta$.