Let $f: \mathbb{R}^2 \to \mathbb{R}$ and $g: \mathbb{R} \to \mathbb{R}$ be twice continuously differentiable functions. I want to compute $$ \frac{\partial^2 g(f)}{\partial x \partial y}(x,y). $$
If I apply the chain rule twice, $$ \frac{\partial g(f)}{\partial y}(x,y) = \frac{\partial g}{\partial f}(f(x,y))\frac{\partial f}{\partial y}(x,y) \qquad (1) $$ and $$ \frac{\partial^2 g(f)}{\partial x \partial y}=\frac{\partial^{2}g}{\partial f^{2}}\frac{\partial f}{\partial x}\frac{\partial f}{\partial y}+\frac{\partial g}{\partial x}\frac{\partial f}{\partial x\partial y}. \qquad (2) $$
Is this correct? Intuitively, I think only the second term should remain, because $x$ and $y$ affects $f$ and then $f$ affects $g$.
You are close but not quite. The correct expressions should be $$\frac{\partial g(f)}{\partial y} = \frac{\color{red}{d}g}{\color{red}{d}f} \frac{\partial f}{\partial y}, \tag{1}$$ and $$\frac{\partial^2 g(f)}{\partial x \, \partial y}=\frac{\color{red}{d}^2g}{\color{red}{d} f^{2}}\frac{\partial f}{\partial x}\frac{\partial f}{\partial y}+\frac{\color{red}{d}g}{\color{red}{df}}\frac{\partial^{\color{red}{2}} f}{\partial x \,\partial y} \tag{2}$$ where I have noted the errors in red. Note we prefer to use $d$ instead of $\partial$ when writing the derivative of $g$ with respect to $f$, since $g : \mathbb R \to \mathbb R$ is a univariate function, although writing $\partial$ is not strictly disallowed. The superscript $2$ in the second-order partial derivative $\frac{\partial^2 f}{\partial x \, \partial y}$ is required otherwise the notation is not consistent. However, the critical error is writing $\partial g/\partial x$ rather than $dg/df$. The other issues might be dismissed as oversights, but this one is a major problem.
If you have any doubts, you can of course pick some simple but nontrivial functions; e.g., $$f(x,y) = x^2 y + y^3, \quad g(f) = \sin f.$$ Then we have $$g(f(x,y)) = \sin (x^2 y + y^3)$$ and $$\begin{align} \frac{\partial f}{\partial x} &= 2xy, \\ \frac{\partial f}{\partial y} &= x^2 + 3y^2, \\ \frac{\partial^2 f}{\partial x \, \partial y} &= 2x, \\ \frac{d g}{d f} &= \cos f, \\ \frac{d^2 g}{df^2} &= -\sin f. \end{align}$$ Then we have $$\frac{\partial g(f(x,y))}{\partial y} = \frac{dg}{df} \frac{\partial f}{\partial y} = (\cos f)(x^2 + 3y^2) = (x^2 + 3y^2) \cos (x^2 y + y^3)$$ by the formula you obtained, and $$\frac{\partial g(f(x,y))}{\partial y} = \frac{\partial}{\partial y}\left[\sin (x^2 y + y^3)\right] = \cos (x^2 y + y^3) \cdot (x^2 + 3y^2)$$ by direct application of partial differentiation to the explicit composition.
Similarly, the mixed partial derivative is via the formula $(2)$ $$\begin{align} \frac{\partial^2 g(f(x,y))}{\partial x \, \partial y} &= (-\sin f)(2xy)(x^2 + 3y^2) + (\cos f)(2x) \\ &= -2xy(x^2+3y^2) \sin (x^2y + y^3) + 2x \cos (x^2 y + y^3), \end{align}$$ and by differentiating the composition, $$\begin{align} \frac{\partial^2 g(f(x,y))}{\partial x \, \partial y} &= \frac{\partial}{\partial x} \left[ \frac{\partial}{\partial y} \left[ \sin (x^2 y + y^3) \right] \right] \\ &= \frac{\partial}{\partial x} \left[ (x^2 + 3y^2) \cos (x^2 y + y^3) \right] \\ &= (x^2 + 3y^2) (-\sin (x^2 y + y^3) \cdot 2xy) + (2x) \cos (x^2 y + y^3) \\ &= -2xy(x^2 + 3y^2) \sin (x^2 y + y^3) + 2x \cos (x^2 y + y^3). \end{align}$$