First we have to be careful with the notation. We will introduce variables $u$ and $v$ to denote the "first" and "second" arguments of $f$ so that we can write the function as $f(u,v)$.
Now you're interested in differentiating $f(x,g(x,y))$ with respect to $x$. Here we have $u=x$ and $v=g(x,y)$. The chain rules tells us to compute the following,
$$ \frac{\partial f}{\partial x} = \frac{\partial u}{\partial x} \left( \frac{\partial f(u,v)}{\partial u} \right)_{u=x,v=g(x,y)}+ \frac{\partial v}{\partial{x}} \left( \frac{\partial f(u,v)}{\partial v} \right)_{u=x,v=g(x,y)}$$
$$ = \left( \frac{\partial f(u,v)}{\partial u} \right)_{u=x,v=g(x,y)}+ \frac{\partial g(x,y)}{\partial{x}} \left( \frac{\partial f(u,v)}{\partial v} \right)_{u=x,v=g(x,y)}$$