In my differential equation book, I have the following equation:
$$\dfrac{\partial f(x,y)}{\partial x}+\dfrac{\partial f(x,y)}{\partial y}\dfrac{dy}{dx}=0$$
Here $y=g(x)$. So how does it make sense to say, $\left( \text{in} \dfrac{\partial f(x,y)}{\partial x} \right)$, we keep $y$ constant and change $x$?

The notation is particularly confusing here (although not uncommon, unfortunately) because $x$ and $y$ are used in two very different ways.
In $\frac{dy}{dx}$, we are thinking of $y$ as a function of the variable $x$. Let's write this as $y = g(x)$.
However, in the expressions $f(x,y)$ and $\frac{\partial f(x,y)}{\partial x}$, these are not the same $x$ and $y$ above. $f$ is a function of two independent variables which we (unfortunately) are also calling $x$ and $y$. Then $\frac{\partial f(x,y)}{\partial x}$ means: differentiate $f$ with respect to that first independent variable $x$, then substitute $(x,y)$ which are now our original (dependent) $x$ and $y$ related by $y = g(x)$. This is all quite confusing, I agree.
A less confusing way to write it is as follows. Rename the independent variables in $f$. Call them $s$ and $t$. Then instead of writing $\frac{\partial f(x,y)}{\partial x}$, write it as $\frac{\partial f}{\partial s}(x,y)$, or even more explicitly, $\frac{\partial f}{\partial s}|_{s=x,t=y}$. Now this is much clearer: We differentiate $f$, a function of two independent variables $s$ and $t$, with respect to the first variable $s$. Then we substitute $s = x$ and $t = y$ into the result. Now it should be clear that the fact that $x$ and $y$ are dependent doesn't matter.
Another way is to choose a different notation for partial derivatives that doesn't involve giving names to the independent variables at all, but instead just indicates them by position: $f_1$ means differentiate with respect to the first variable, $f_2$ with respect to the second variable. Now we can just write $f_1(x,y)$ and $f_2(x,y)$.