How does partial derivative make sense here? 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$?

 A: 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)$.
A: Many students encounter this difficulty to understand. This is due to a lack of mastery of total and partial derivative. You can find a detailed explanation in :
What do the partial derivates mean in the formulation of total derivate?
The total derivative of $f(x,y)$ is :
$$df=\frac{\partial f}{\partial x}dx+\frac{\partial f}{\partial y}dy \tag 1$$
This is definitively true, even if $x$ and/or $y$ becomes fonction of another variable, for exemple $x(t)$ and $y(t)$. In this case $f(x,y)$ becomes a function of $t$, that is $f(x(t),y(t))$.
Then $dx=\frac{dx}{dt}dt$ and $dy=\frac{dy}{dt}dt$
Putting them into Eq.$(1)$ gives :
$$df=\frac{\partial f}{\partial x}\frac{dx}{dt}dt+\frac{\partial f}{\partial y}\frac{dy}{dt}dt$$
The total derivative with respect to $t$ is :
$$\frac{df}{dt}=\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\frac{dy}{dt}$$
This is true whatever $t$ is, even if $t=x$.
In the case of $t=x$ , that is $f(x,y(x))$
$$\frac{df}{dx}=\frac{\partial f}{\partial x}\frac{dx}{dx}+\frac{\partial f}{\partial y}\frac{dy}{dx}$$
$$\frac{df}{dx}=\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{dy}{dx}$$
You wrote :
Here $y=f(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$?
Your first mistake is in $y=f(x)$ : this is false. You confuse the function $f(x,y(x))$ with the function $y=y(x)$.
Your second mistake is to think that $y$ is changed when computing $\left( \frac{\partial f(x,y)}{\partial x}\right)$, which should be the negation of the definition of partial derivative. Read again the above Eq.$(1)$ which is definitively true, even if $x$ and/or $y$ becomes fonction of another variable. At this step, $y$ is not yet function of $x$. Latter on, it is decided to make $y$ function of $x$. Then instead of $\frac{\partial f}{\partial x}$ we have $\frac{\partial f}{\partial y}\frac{dy}{dx}$.
