Say we have a complex function $f(z)$. Then $z = x + iy$, so $z$ can be thought of as a function of $x$ and $y$. Thus we can take partial derivatives to get $$\frac{dz}{dx} = 1,\ \frac{dz}{dy} = i.$$
So by the chain rule, can we say that
$$\frac{df}{dz} = \frac{df}{dx}\cdot \frac{dx}{dz} + \frac{df}{dy}\cdot \frac{dy}{dz} = \frac{df}{dx} - i\cdot \frac{df}{dy}\ ?$$
However, I know that this goes against the Cauchy-Riemann equations since $\frac{df}{dz}$ is actually equal to $\frac{df}{dx}$ and $-i\cdot \frac{df}{dy}$. Am I missing something obvious here?
The chain rule is requiring that the functions are differentiable, and $x,y$ are not differentiable with respect to $z$.
Also, another mistake in the computation is the fact that the formulas $$\frac{dx}{dz}=\frac{1}{\frac{dz}{dx}}$$ require $z$ to be a (locally) 1-1 function in $x$, and this is not happening.