Changing the variable from $g$ to $u = g - f(x,y)$ gives
$$\eqalign{
\int_{-\infty}^{t}\delta(g - f(x,y))dg =\int_{-\infty}^{t-f(x,y)}\delta(u)du = I_{t - f(x,y) \ge 0} = I_{f(x,y)\le t}
}$$
(where $I$ is an indicator function). This is the definition of $\delta$. Now write the CDF for $g$ as an integral; namely,
$$\eqalign{
\int_{-\infty}^{t} f_G(g)dg = &G(t) \\
= &\mathbb{P}[f(x,y)\le t] \\
= &\iint_{\{f(x,y)\le t\}}f_X(x)f_Y(y)dx dy \\
= &\iint I_{f(x,y)\le t}f_X(x)f_Y(y)dx dy \\
= &\iint\left(\int_{-\infty}^{t}\delta(g - f(x,y))dg\right)f_X(x)f_Y(y)dx dy \\
= &\int_{-\infty}^{t} \left(\iint\delta(g - f(x,y)) f_X(x)f_Y(y)dx dy\right) dg. \\
}$$
Every step of this but the last merely applied a definition (of the pdf, of the CDF, of $\mathbb{P}$, and of the integral, in that order) or the preceding result. The last step is Fubini's Theorem extended to distributions.
The idea to do it this way comes from the fundamental intuition for working with generalized functions ("distributions") like $\delta$: they are defined in terms of integration by parts. Taking this as an invitation to integrate $\delta(g - f(x,y))dg$ leads to the first observation and everything follows readily.