When you write $\displaystyle \frac{dz}{dx}$ you are assuming that $z$ is a function of $x$ only. This forces $y$ to be a function of $x$, therefore abusing the notation we write $y=y(x)$. Meanwhile, we have that $f$ continues to be a function of two variables, therefore $\displaystyle \frac{\partial f}{\partial x}$ means the usual partial derivative with respect to $x$.
When we take total derivatives we usually write it this way:
$$dz = \frac{\partial f}{\partial x} dx + \frac{\partial f}{\partial y} dy.$$
If we assume $z$ is a function of a certain parameter $t$ then we'd have
$$\frac{dz}{dt} = \frac{\partial f}{\partial x} \frac{dx}{dt} + \frac{\partial f}{\partial y} \frac{dy}{dt}.$$
In this case the parameter is $x$ itself, and we'd abuse notation by writing
$$\frac{dz}{dx} = \frac{\partial f}{\partial x} \frac{dx}{dx} + \frac{\partial f}{\partial y} \frac{dy}{dx} = \frac{\partial f}{\partial x} + \frac{\partial f}{\partial y} \frac{dy}{dx}.$$
We are saying that "dx/dx = 1", essentially.