[proofplan]
Choose a bundle metric on $E$ and use the orientation to define a fibrewise rotation by $\pi/2$, thereby turning $E$ into the underlying real bundle of a complex line bundle $L$. Under the standard normalization of the Euler class for oriented real two-plane bundles, $e(E)=c_1(L)$. The complexification of $E$ then splits as $L\oplus \overline L$, so the Whitney product formula and the conjugation rule for Chern classes give $c_2(E_{\mathbb C})=-e(E)^2$. Finally, the definition of Pontryagin classes through the complexification gives $p_1(E)=-c_2(E_{\mathbb C})=e(E)^2$.
[/proofplan]
custom_env
admin
[step:Use the orientation and a metric to make $E$ into a complex line bundle]
Since $M$ is paracompact, choose a smooth bundle metric $h$ on $E$. For each $p\in M$, let
\begin{align*}
J_p:E_p\to E_p
\end{align*}
be the unique $h_p$-orthogonal [linear map](/page/Linear%20Map) satisfying $J_p^2=-\operatorname{id}_{E_p}$ and such that, for every nonzero $v\in E_p$, the ordered basis $(v,J_pv)$ is positively oriented. In any positively oriented local $h$-orthonormal frame $(e_1,e_2)$, this endomorphism is given by $J e_1=e_2$ and $J e_2=-e_1$, so the assignment $p\mapsto J_p$ is smooth.
Define $L$ to be the complex line bundle whose underlying real bundle is $E$ and whose multiplication by $i$ is the bundle endomorphism $J:E\to E$. Thus, for $a,b\in\mathbb R$ and $v\in E_p$, the scalar multiplication is
\begin{align*}
(a+ib)v:=av+bJ_pv.
\end{align*}
With the standard Euler-Chern normalization for oriented real two-plane bundles, the Euler class of $E$ is the first Chern class of this associated complex line bundle:
\begin{align*}
e(E)=c_1(L)
\end{align*}
in $H^2_{\mathrm{dR}}(M)$.
[/step]
custom_env
admin
[step:Identify the complexification with the line bundle and its conjugate]
Let
\begin{align*}
E_{\mathbb C}:=E\otimes_{\mathbb R}\mathbb C
\end{align*}
be the complexification of the real vector bundle $E$. Extend $J$ complex-linearly to a bundle endomorphism
\begin{align*}
J_{\mathbb C}:E_{\mathbb C}\to E_{\mathbb C}.
\end{align*}
For each $p\in M$, the complex [vector space](/page/Vector%20Space) $(E_{\mathbb C})_p$ decomposes into the $i$- and $-i$-eigenspaces of $(J_{\mathbb C})_p$:
\begin{align*}
(E_{\mathbb C})_p=(E_{\mathbb C})_{p,i}\oplus (E_{\mathbb C})_{p,-i}.
\end{align*}
The map
\begin{align*}
\Phi_p:L_p\to (E_{\mathbb C})_{p,i}
\end{align*}
defined by
\begin{align*}
\Phi_p(v)=v\otimes 1-J_pv\otimes i
\end{align*}
is complex-linear and bijective. Similarly, the $-i$-eigenspace is naturally identified with the conjugate complex line $\overline L_p$. These fibrewise maps vary smoothly in local frames, so they assemble to a complex vector bundle isomorphism
\begin{align*}
E_{\mathbb C}\cong L\oplus \overline L.
\end{align*}
[/step]
custom_env
admin
[step:Compute the second Chern class of the complexification]By the [Whitney product formula for Chern classes](/theorems/7052) applied to the complex vector bundle isomorphism $E_{\mathbb C}\cong L\oplus \overline L$, one has
\begin{align*}
c(E_{\mathbb C})=c(L)c(\overline L).
\end{align*}
Since $L$ and $\overline L$ are complex line bundles,
\begin{align*}
c(L)=1+c_1(L)
\end{align*}
and
\begin{align*}
c(\overline L)=1+c_1(\overline L).
\end{align*}
By [citetheorem:9778] applied to the complex line bundle $L$, the first Chern class of the conjugate line bundle satisfies
\begin{align*}
c_1(\overline L)=-c_1(L).
\end{align*}
Therefore
\begin{align*}
c(E_{\mathbb C})=(1+c_1(L))(1-c_1(L)).
\end{align*}
Multiplying in the graded-commutative [cohomology ring](/theorems/2271) $H^*_{\mathrm{dR}}(M)$ gives
\begin{align*}
c(E_{\mathbb C})=1-c_1(L)^2.
\end{align*}
Since $E_{\mathbb C}$ has complex rank $2$, the degree-four component is
\begin{align*}
c_2(E_{\mathbb C})=-c_1(L)^2.
\end{align*}
Using $c_1(L)=e(E)$, this becomes
\begin{align*}
c_2(E_{\mathbb C})=-e(E)^2.
\end{align*}[/step]
custom_env
admin
[guided]The point of passing to $L\oplus \overline L$ is that Chern classes are easy for line bundles and behave multiplicatively under direct sums. The isomorphism from the previous step lets us apply the Whitney product formula:
\begin{align*}
c(E_{\mathbb C})=c(L\oplus \overline L)=c(L)c(\overline L).
\end{align*}
For a complex line bundle, all Chern classes above degree one vanish, so its total Chern class is completely determined by its first Chern class:
\begin{align*}
c(L)=1+c_1(L).
\end{align*}
The same statement applies to $\overline L$:
\begin{align*}
c(\overline L)=1+c_1(\overline L).
\end{align*}
Now we use the effect of conjugation on Chern classes. By [citetheorem:9778] with $k=1$, applied to the complex line bundle $L\to M$, one has
\begin{align*}
c_1(\overline L)=-c_1(L).
\end{align*}
Substituting this into the Whitney product computation gives
\begin{align*}
c(E_{\mathbb C})=(1+c_1(L))(1-c_1(L)).
\end{align*}
The degree-two terms cancel, and the degree-four term is the negative square:
\begin{align*}
c(E_{\mathbb C})=1-c_1(L)^2.
\end{align*}
Because $E_{\mathbb C}$ has complex rank $2$, its second Chern class is exactly the degree-four component of its total Chern class. Hence
\begin{align*}
c_2(E_{\mathbb C})=-c_1(L)^2.
\end{align*}
Finally, the complex line bundle $L$ was built from the oriented two-plane bundle $E$, and the Euler-Chern normalization gives
\begin{align*}
c_1(L)=e(E).
\end{align*}
Therefore
\begin{align*}
c_2(E_{\mathbb C})=-e(E)^2.
\end{align*}[/guided]
custom_env
admin
[step:Convert the Chern class computation into the Pontryagin class identity]
By the definition of Pontryagin classes through the complexification, equivalently by [citetheorem:9780] with $k=1$, the first Pontryagin class of $E$ satisfies
\begin{align*}
p_1(E)=(-1)^1c_2(E_{\mathbb C}).
\end{align*}
Thus
\begin{align*}
p_1(E)=-c_2(E_{\mathbb C}).
\end{align*}
Using the computation from the previous step,
\begin{align*}
p_1(E)=-(-e(E)^2).
\end{align*}
Hence
\begin{align*}
p_1(E)=e(E)^2.
\end{align*}
This is the desired identity in $H^4_{\mathrm{dR}}(M)$.
[/step]