[guided]The desired identity says that integrating over the pushed-forward measure $\gamma_T=(G_T)_{\#}\mu$ is the same as pulling the function back along $G_T$ and integrating over $\mu$. We verify this directly, because the cost $c$ may be extended-valued.
Start with indicator functions. Let $E\in\mathcal A\otimes\mathcal B$ and define the indicator function $\mathbb 1_E:X\times Y\to\{0,1\}$ by $\mathbb 1_E(z)=1$ for $z\in E$ and $\mathbb 1_E(z)=0$ for $z\notin E$. By the defining property of the pushforward measure,
\begin{align*}
\gamma_T(E)=\mu(G_T^{-1}(E)).
\end{align*}
Hence
\begin{align*}
\int_{X\times Y}\mathbb 1_E(x,y)\,d\gamma_T(x,y)=\gamma_T(E)=\mu(G_T^{-1}(E)).
\end{align*}
On the other hand, the pulled-back indicator $\mathbb 1_E\circ G_T:X\to\{0,1\}$ is the indicator of $G_T^{-1}(E)$, so
\begin{align*}
\int_X \mathbb 1_E(G_T(x))\,d\mu(x)=\mu(G_T^{-1}(E)).
\end{align*}
Thus both integrals agree for indicators.
Now take a non-negative [simple function](/page/Simple%20Function) $s:X\times Y\to[0,\infty)$. Such a function is a finite sum of scalar multiples of indicators of measurable sets. Since the integral is finite-linearly compatible with such sums, the indicator calculation gives
\begin{align*}
\int_{X\times Y}s(x,y)\,d\gamma_T(x,y)=\int_X s(G_T(x))\,d\mu(x).
\end{align*}
Next let $f:X\times Y\to[0,\infty]$ be any non-negative measurable function. By the standard approximation of non-negative measurable functions by simple functions, choose a sequence $(s_n)_{n\in\mathbb N}$ of non-negative simple $\mathcal A\otimes\mathcal B$-measurable functions
\begin{align*}
s_n:X\times Y\to[0,\infty)
\end{align*}
such that $s_n\uparrow f$ pointwise. Since $G_T$ is $\mathcal A/(\mathcal A\otimes\mathcal B)$-measurable, each composition $s_n\circ G_T:X\to[0,\infty)$ is a non-negative simple $\mathcal A$-measurable function. The pointwise monotonicity is preserved after composition: for every $x\in X$, $s_n(G_T(x))\uparrow f(G_T(x))$.
We now apply the Monotone Convergence Theorem on the product [measure space](/page/Measure%20Space) $(X\times Y,\mathcal A\otimes\mathcal B,\gamma_T)$ and on the source measure space $(X,\mathcal A,\mu)$. It gives
\begin{align*}
\int_{X\times Y}f(x,y)\,d\gamma_T(x,y)=\lim_{n\to\infty}\int_{X\times Y}s_n(x,y)\,d\gamma_T(x,y)
\end{align*}
and
\begin{align*}
\int_X f(G_T(x))\,d\mu(x)=\lim_{n\to\infty}\int_X s_n(G_T(x))\,d\mu(x).
\end{align*}
For every $n\in\mathbb N$, the simple-function identity already proved gives
\begin{align*}
\int_{X\times Y}s_n(x,y)\,d\gamma_T(x,y)=\int_X s_n(G_T(x))\,d\mu(x).
\end{align*}
Taking limits on both sides yields
\begin{align*}
\int_{X\times Y}f(x,y)\,d\gamma_T(x,y)=\int_X f(G_T(x))\,d\mu(x).
\end{align*}
Finally apply this non-negative identity to the positive and negative parts of the cost. Define
\begin{align*}
c^+:X\times Y\to[0,\infty]
\end{align*}
by $c^+(x,y)=\max\{c(x,y),0\}$, and define
\begin{align*}
c^-:X\times Y\to[0,\infty]
\end{align*}
by $c^-(x,y)=\max\{-c(x,y),0\}$. Then $c=c^+-c^-$. The hypothesis that the two extended integrals are well-defined is used exactly here: it rules out subtracting $\infty$ from $\infty$. Applying the non-negative formula to $c^+$ and $c^-$ and subtracting the two well-defined extended quantities gives
\begin{align*}
\int_{X\times Y}c(x,y)\,d\gamma_T(x,y)=\int_X c(G_T(x))\,d\mu(x).
\end{align*}
Because $G_T(x)=(x,T(x))$, the right-hand side is
\begin{align*}
\int_X c(x,T(x))\,d\mu(x).
\end{align*}
Thus
\begin{align*}
\int_{X\times Y}c(x,y)\,d\gamma_T(x,y)=\int_X c(x,T(x))\,d\mu(x).
\end{align*}[/guided]