Let us say $f : \mathbb{R}^{n + 1} \to \mathbb{R}$ is $C_1$ and we have some point where $\partial_yf(x_0,y_o) \neq 0$. By the implicit function theorem, we can write $y = g(x)$ where $g$ is some $C^1$ function from $\mathbb{R^n} \to \mathbb{R}$. Moreover, a common formula comes up, as I have seen but I'm not sure how its derived. It relates the derivative of $g$ with respect to each basis vector, to the derivatives of $f$. Specifically it says that where $y = g(x)$ (i.e where y can be written as a function of $x$) that: $$ \frac{\partial g}{\partial x_i}(x,g(x)) = -\frac{\frac{\partial f}{\partial x_i}(x,g(x))}{\frac{\partial f}{\partial y}(x,g(x))} $$
How is this formula derived? Most books say it is through the chain rule. Moreover, how does this generalize for the implicit function theorem for mappings $\mathbb{R^{m+n}} \to \mathbb{R}^m$? I am slightly confused in this respect.
For the formula: \begin{align*} f(x,g(x))&=0\\ \dfrac{\partial}{\partial x_{i}}f(\cdot,g(\cdot))&=0\\ \dfrac{\partial}{\partial x_{i}}f(x,g(x))+\dfrac{\partial f}{\partial y}(x,g(x))\cdot\dfrac{\partial g}{\partial x_{i}}(x)&=0, \end{align*} after simplifying, the formula is derived.