Let $g:\mathbb{R^2} \to \mathbb{R}$ with $g(x,y) := (\sin(xy))^2$.
I want to find the set of points $D$, in which this function is partially differentiable and calculate its partial derivatives and gradient there.
I'd say $D(g)=\{(x,y) \mid x,y \in \mathbb{R}\}$
$$\frac{\partial g}{\partial x} = 2y \sin (xy) \cos (xy)$$
and
$$\frac{\partial g}{\partial y} = 2x \sin (xy) \cos (xy)$$
So the gradient is
$$\nabla g(x,y) = { 2y \sin (xy) \cos (xy)\choose 2x \sin (xy) \cos (xy)}$$
Is this correct?
Yes, $D(g)= \mathbb R^2$ and your partial derivatives are correct.