Suppose $f=f(x,y(x))$.
Then applying the chain rule we get $\frac{\partial f}{\partial x}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}=\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}$.
From this it seems that it always holds that $\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}=0$.
Where's the mistake?