[guided]The delicate point is that $\alpha$, $\beta$, $\varphi$, and $\varphi^*$ may be extended-valued, so we first put affine lower bounds in place before comparing integrals. Since $f$ is finite $\mu$-almost everywhere with $\int_{\mathbb R^n} |f| \, d\mu < \infty$ and $g$ is finite $\nu$-almost everywhere with $\int_{\mathbb R^n} |g| \, d\nu < \infty$, the functions $\alpha$ and $\beta$ are finite almost everywhere for their respective measures. Choose $x_0 \in \mathbb R^n$ with $\alpha(x_0)<\infty$ and $y_0 \in \mathbb R^n$ with $\beta(y_0)<\infty$. From
\begin{align*}
x \cdot y \leq \alpha(x)+\beta(y) \quad \text{for all } x,y \in \mathbb R^n
\end{align*}
we get, by fixing $x=x_0$,
\begin{align*}
\beta(y) \geq x_0 \cdot y-\alpha(x_0) \quad \text{for all } y \in \mathbb R^n.
\end{align*}
This affine lower bound is exactly what prevents the conjugate from degenerating at $x_0$.
Define
\begin{align*}
\varphi: \mathbb R^n \to (-\infty,\infty], \qquad \varphi(x):=\sup_{y \in \mathbb R^n}\{x \cdot y-\beta(y)\}.
\end{align*}
For every $x,y \in \mathbb R^n$, the inequality $x \cdot y \leq \alpha(x)+\beta(y)$ gives $x \cdot y-\beta(y)\leq \alpha(x)$, and taking the supremum over $y$ gives
\begin{align*}
\varphi(x)\leq \alpha(x) \quad \text{for all } x \in \mathbb R^n.
\end{align*}
In particular, $\varphi(x_0)\leq \alpha(x_0)<\infty$. Also, because $\beta(y_0)<\infty$, the single competitor $y_0$ in the supremum gives
\begin{align*}
\varphi(x)\geq x \cdot y_0-\beta(y_0)>-\infty \quad \text{for all } x \in \mathbb R^n.
\end{align*}
Thus $\varphi$ is proper. It is convex and lower semicontinuous because it is the supremum of affine functions of $x$.
Now define
\begin{align*}
\varphi^*: \mathbb R^n \to (-\infty,\infty], \qquad \varphi^*(y):=\sup_{x \in \mathbb R^n}\{x \cdot y-\varphi(x)\}.
\end{align*}
The same competitor $x_0$ gives the affine lower bound
\begin{align*}
\varphi^*(y)\geq x_0 \cdot y-\varphi(x_0) \quad \text{for all } y \in \mathbb R^n.
\end{align*}
Since $\mu$ and $\nu$ have finite second moments, every affine function on $\mathbb R^n$ is integrable with respect to $\mu$ and $\nu$. Therefore the extended integrals of $\varphi$ and $\varphi^*$ are defined from below; no expression of the form $\infty-\infty$ is being used.
Because $\beta$ is proper and bounded below by an affine function, the biconjugate $\beta^{**}$ is well-defined and the Fenchel-Moreau biconjugation inequality gives $\beta^{**}\leq \beta$ pointwise. Since $\varphi=\beta^*$, we have $\varphi^*=\beta^{**}$, so $\varphi^*\leq \beta$ pointwise. Together with $\varphi\leq \alpha$, this yields
\begin{align*}
\int_{\mathbb R^n} \varphi \, d\mu+\int_{\mathbb R^n} \varphi^* \, d\nu\leq \int_{\mathbb R^n} \alpha \, d\mu+\int_{\mathbb R^n} \beta \, d\nu.
\end{align*}
Fenchel's inequality for the proper lower semicontinuous convex function $\varphi$ gives
\begin{align*}
x \cdot y \leq \varphi(x)+\varphi^*(y) \quad \text{for all } x,y \in \mathbb R^n.
\end{align*}
Integrating against any coupling $\pi \in \Pi(\mu,\nu)$ gives
\begin{align*}
\int_{\mathbb R^n \times \mathbb R^n} x \cdot y \, d\pi(x,y)\leq \int_{\mathbb R^n} \varphi \, d\mu+\int_{\mathbb R^n} \varphi^* \, d\nu.
\end{align*}
Taking the supremum over all couplings gives
\begin{align*}
\sup_{\pi \in \Pi(\mu,\nu)}\int_{\mathbb R^n \times \mathbb R^n} x \cdot y \, d\pi(x,y)\leq \int_{\mathbb R^n} \varphi \, d\mu+\int_{\mathbb R^n} \varphi^* \, d\nu.
\end{align*}
On the other hand, the previous comparison with $\alpha$ and $\beta$ gives
\begin{align*}
\int_{\mathbb R^n} \varphi \, d\mu+\int_{\mathbb R^n} \varphi^* \, d\nu\leq \int_{\mathbb R^n} \alpha \, d\mu+\int_{\mathbb R^n} \beta \, d\nu.
\end{align*}
It remains to identify the right-hand side. From the definitions of $\alpha$ and $\beta$,
\begin{align*}
\int_{\mathbb R^n} \alpha \, d\mu+\int_{\mathbb R^n} \beta \, d\nu=\frac{1}{2}\left(A-\int_{\mathbb R^n} f \, d\mu-\int_{\mathbb R^n} g \, d\nu\right),
\end{align*}
where
\begin{align*}
A:=\int_{\mathbb R^n} |x|^2 \, d\mu(x)+\int_{\mathbb R^n} |y|^2 \, d\nu(y).
\end{align*}
Dual optimality for $f,g$ says
\begin{align*}
\int_{\mathbb R^n} f \, d\mu+\int_{\mathbb R^n} g \, d\nu=\int_{\mathbb R^n \times \mathbb R^n} |x-y|^2 \, d\pi_0(x,y).
\end{align*}
Expanding $|x-y|^2=|x|^2+|y|^2-2x\cdot y$ and using that $\pi_0$ has marginals $\mu$ and $\nu$, we get
\begin{align*}
\int_{\mathbb R^n} \alpha \, d\mu+\int_{\mathbb R^n} \beta \, d\nu=\int_{\mathbb R^n \times \mathbb R^n} x\cdot y \, d\pi_0(x,y).
\end{align*}
Since $\pi_0$ is a coupling, this last quantity is at most the correlation supremum. Combining the three inequalities forces equality:
\begin{align*}
\int_{\mathbb R^n} \varphi \, d\mu+\int_{\mathbb R^n} \varphi^* \, d\nu=\sup_{\pi \in \Pi(\mu,\nu)}\int_{\mathbb R^n \times \mathbb R^n} x \cdot y \, d\pi(x,y).
\end{align*}[/guided]