Take the derivative according to x and consider function of y as constants. You get:
$$z=x^2f(y)+y^2g(x)$$
$$\partial_yz=\partial_y(x^2f(y)+y^2g(x))=x^2f'(y)+2yg(x)$$
$$\partial_xz=\partial_x(x^2f(y)+y^2g(x))=2xf(y)+y^2g'(x)$$
differentiating twice according to x first then according to y
$$\partial_{yx}z=2xf'(y)+2yg'(x)=\partial_{xy}z$$
Take the derivative according to x and consider function of y as constants. You get:
$$z=x^2f(y)+y^2g(x)$$ $$\partial_yz=\partial_y(x^2f(y)+y^2g(x))=x^2f'(y)+2yg(x)$$ $$\partial_xz=\partial_x(x^2f(y)+y^2g(x))=2xf(y)+y^2g'(x)$$ differentiating twice according to x first then according to y $$\partial_{yx}z=2xf'(y)+2yg'(x)=\partial_{xy}z$$