[proofplan]
The proof is the degree-four specialization of the [Hirzebruch signature theorem](/theorems/9789). That theorem identifies the signature with the evaluation of the Hirzebruch $L$-class on the fundamental class. In dimension $4$, only the first component $L_1$ can contribute, and the defining [power series](/page/Power%20Series) for the $L$-class gives $L_1=\frac{1}{3}p_1$. The stated Chern-Weil convention then identifies the de Rham representative of $p_1(TX)$ with the form $p_1(\Omega)$.
[/proofplan]
[step:Apply the Hirzebruch signature theorem in dimension four]
Since $X$ is closed and oriented, and since $\dim X=4=4\cdot 1$, the [citetheorem:9789] applies in the case of one four-dimensional block. The signature appearing in that theorem is the signature of the middle-dimensional cup-product intersection form over real cohomology, hence it is the number denoted $\sigma(X)$ in the statement. Let
\begin{align*}
H^{4*}(X;\mathbb R):=\bigoplus_{j\ge 0}H^{4j}(X;\mathbb R)
\end{align*}
denote the real cohomology groups in degrees divisible by $4$, and let $L(TX)\in H^{4*}(X;\mathbb R)$ denote the total Hirzebruch $L$-class of the tangent bundle. The signature theorem gives
\begin{align*}
\sigma(X)=\left\langle L(TX),[X]\right\rangle.
\end{align*}
Write the total $L$-class as
\begin{align*}
L(TX)=1+L_1(TX)+L_2(TX)+\cdots,
\end{align*}
where $L_j(TX)\in H^{4j}(X;\mathbb R)$. Since $X$ has dimension $4$, the pairing with $[X]\in H_4(X;\mathbb R)$ only sees the degree-$4$ component. Hence
\begin{align*}
\sigma(X)=\left\langle L_1(TX),[X]\right\rangle.
\end{align*}
[guided]
The role of the general signature theorem is to convert an analytic-topological invariant, the signature $\sigma(X)$, into a characteristic-number calculation. Its hypotheses are satisfied here: $X$ is closed, oriented, and smooth, and its dimension is $4=4\cdot 1$. The signature in the cited theorem is the signature of the middle-dimensional cup-product intersection form over real cohomology, which is exactly the form $Q_X$ used in the statement. Therefore the [citetheorem:9789] gives
\begin{align*}
\sigma(X)=\left\langle L(TX),[X]\right\rangle.
\end{align*}
Now we isolate which part of $L(TX)$ can actually be evaluated on the fundamental class. The notation $H^{4*}(X;\mathbb R)$ means the [direct sum](/page/Direct%20Sum) $\bigoplus_{j\ge 0}H^{4j}(X;\mathbb R)$ of the real cohomology groups in degrees divisible by $4$. The total Hirzebruch $L$-class is an even characteristic class of the form
\begin{align*}
L(TX)=1+L_1(TX)+L_2(TX)+\cdots,
\end{align*}
with $L_j(TX)\in H^{4j}(X;\mathbb R)$, where $H^{4j}(X;\mathbb R)$ denotes real cohomology in degree $4j$. The oriented fundamental class $[X]$ lies in $H_4(X;\mathbb R)$, the real singular homology group in degree $4$, so only a cohomology class of degree $4$ pairs nontrivially with it. The degree $0$ term pairs with $H_0$, not with $[X]$, and the terms of degree at least $8$ vanish on a $4$-manifold. Thus the signature theorem reduces in this dimension to
\begin{align*}
\sigma(X)=\left\langle L_1(TX),[X]\right\rangle.
\end{align*}
[/guided]
[/step]
[step:Replace the first $L$-class by one third of the first Pontryagin class]
The Hirzebruch $L$-class is defined by the multiplicative sequence associated to the formal power series
\begin{align*}
Q(z)=\frac{z}{\tanh z}\in \mathbb R[[z]].
\end{align*}
The Taylor expansion of $\tanh z$ means that there exists a formal power series $A(z)\in \mathbb R[[z]]$ such that
\begin{align*}
\tanh z=z-\frac{z^3}{3}+z^5A(z).
\end{align*}
Since $1-\frac{z^2}{3}+z^4A(z)$ has constant term $1$, it is invertible in $\mathbb R[[z]]$. Formal division therefore gives a formal power series $B(z)\in \mathbb R[[z]]$ such that
\begin{align*}
\frac{z}{\tanh z}=1+\frac{z^2}{3}+z^4B(z).
\end{align*}
By the splitting-principle description of Pontryagin classes, if $x_1,\dots,x_m$ are the formal Pontryagin roots of a real vector bundle, equivalently the degree-$2$ Chern roots of its complexification paired so that $p_1$ is represented by $x_1^2+\cdots+x_m^2$, then the coefficient of $z^2$ in $Q(z)$ is one third, and it gives the degree-$4$ component of the associated multiplicative sequence:
\begin{align*}
L_1=\frac{1}{3}p_1.
\end{align*}
Applying this universal identity to the real vector bundle $TX\to X$ gives
\begin{align*}
L_1(TX)=\frac{1}{3}p_1(TX)\in H^4(X;\mathbb R).
\end{align*}
Therefore
\begin{align*}
\sigma(X)=\frac{1}{3}\left\langle p_1(TX),[X]\right\rangle.
\end{align*}
[guided]
The total Hirzebruch $L$-class is determined by the multiplicative sequence associated to
\begin{align*}
Q(z)=\frac{z}{\tanh z}\in \mathbb R[[z]].
\end{align*}
To find the degree-$4$ part, only the coefficient of $z^2$ matters. The Taylor expansion at $0$ means that there exists a formal power series $A(z)\in \mathbb R[[z]]$ such that
\begin{align*}
\tanh z=z-\frac{z^3}{3}+z^5A(z).
\end{align*}
Factoring out $z$ gives
\begin{align*}
\tanh z=z\left(1-\frac{z^2}{3}+z^4A(z)\right).
\end{align*}
The factor $1-z^2/3+z^4A(z)$ has constant term $1$, so it is invertible in the power-series ring $\mathbb R[[z]]$. Multiplying through degree $2$ shows that its inverse has coefficient $1/3$ on $z^2$; equivalently, there exists a formal power series $B(z)\in \mathbb R[[z]]$ such that
\begin{align*}
\frac{z}{\tanh z}=\left(1-\frac{z^2}{3}+z^4A(z)\right)^{-1}=1+\frac{z^2}{3}+z^4B(z).
\end{align*}
In the multiplicative sequence, the $z^2$ coefficient contributes the first Pontryagin class in degree $4$ as follows. By the splitting-principle description of Pontryagin classes, if $x_1,\dots,x_m$ are the formal Pontryagin roots of a real vector bundle, equivalently the degree-$2$ Chern roots of its complexification paired so that the first Pontryagin class is represented universally by
\begin{align*}
p_1=x_1^2+\cdots+x_m^2.
\end{align*}
The product defining the multiplicative sequence is $\prod_i Q(x_i)$. Keeping only degree $4$ terms, the coefficient of $z^2$ in $Q(z)$ gives
\begin{align*}
\frac{1}{3}(x_1^2+\cdots+x_m^2)=\frac{1}{3}p_1.
\end{align*}
Therefore the universal degree-$4$ component is
\begin{align*}
L_1=\frac{1}{3}p_1.
\end{align*}
Applying this universal identity to the real tangent bundle $TX\to X$ gives
\begin{align*}
L_1(TX)=\frac{1}{3}p_1(TX)\in H^4(X;\mathbb R).
\end{align*}
Substituting this into the result of the previous step yields
\begin{align*}
\sigma(X)=\frac{1}{3}\left\langle p_1(TX),[X]\right\rangle.
\end{align*}
[/guided]
[/step]
[step:Identify the Pontryagin number with the Chern-Weil integral]
By the convention in the statement, the Chern-Weil form
\begin{align*}
p_1(\Omega)=-\frac{1}{8\pi^2}\operatorname{tr}(\Omega\wedge\Omega)
\end{align*}
represents the de Rham cohomology class $p_1(TX)$. Let $f_\Omega:X\to\mathbb R$ be the smooth function defined by
\begin{align*}
p_1(\Omega)=f_\Omega\operatorname{vol}_g.
\end{align*}
Hence evaluation on the oriented fundamental class is integration of this representative against the associated volume measure:
\begin{align*}
\left\langle p_1(TX),[X]\right\rangle=\int_X f_\Omega\,d\operatorname{vol}_g.
\end{align*}
Substituting this identity into the formula obtained above gives
\begin{align*}
\sigma(X)=\frac{1}{3}\int_X f_\Omega\,d\operatorname{vol}_g=\frac{1}{3}\left\langle p_1(TX),[X]\right\rangle.
\end{align*}
This is the desired four-dimensional Hirzebruch signature formula.
[guided]
The statement has fixed the Chern-Weil convention by declaring
\begin{align*}
p_1(\Omega)=-\frac{1}{8\pi^2}\operatorname{tr}(\Omega\wedge\Omega).
\end{align*}
It also assumes that this closed $4$-form represents the de Rham class $p_1(TX)\in H^4(X;\mathbb R)$. Since $X$ is oriented and Riemannian of dimension $4$, the Riemannian volume form $\operatorname{vol}_g\in\Omega^4(X)$ identifies every smooth $4$-form with a unique smooth function. Thus the function $f_\Omega:X\to\mathbb R$ is defined by
\begin{align*}
p_1(\Omega)=f_\Omega\operatorname{vol}_g.
\end{align*}
By the de Rham pairing with the oriented fundamental class, evaluating the cohomology class represented by $p_1(\Omega)$ on $[X]$ is integration of that representative over $X$. With the chosen volume-measure notation, this gives
\begin{align*}
\left\langle p_1(TX),[X]\right\rangle=\int_X f_\Omega\,d\operatorname{vol}_g.
\end{align*}
Substituting this identity into
\begin{align*}
\sigma(X)=\frac{1}{3}\left\langle p_1(TX),[X]\right\rangle
\end{align*}
produces
\begin{align*}
\sigma(X)=\frac{1}{3}\int_X f_\Omega\,d\operatorname{vol}_g=\frac{1}{3}\left\langle p_1(TX),[X]\right\rangle.
\end{align*}
This is precisely the stated four-dimensional Hirzebruch signature formula.
[/guided]
[/step]