Differentiability of composite functions I am supposed to prove that if a certain complex ($U\to\mathbb{C}$ with $U\subset\mathbb{C}$) function $f$ is continuous at $z_0\in U$, a certain complex ($f(U)\to\mathbb{C}$) function $g$ is differentiable with $g'(f(z_0))\ne0$, and $g\circ f$ is differentiable at $z_0$, then $f$ is differentiable at $z_0$. My question is whether $g\circ f$ can be differentiable if $f$ is not? All my lecture notes and textbook say is that $g\circ f$ is differentiable if both $g$ and $f$ are differentiable, but not that this is a necessary condition, so I'm a bit lost with this question.
 A: Logic
The theorem is: If $\color{red}{f\style{font-family:inherit;}{\text{ is continuous at }}z_0}$ and $\color{blue}{g'(f(z_0))\ne0}$ and $\color{purple}{g\circ f\style{font-family:inherit;}{\text{ is differentiable at }}z_0}$ then $\color{orange}{f\style{font-family:inherit;}{\text{ is differentiable at }}z_0}$.
The contrapositive is: If
$\color{orange}{f\style{font-family:inherit;}{\text{ is }}\style{font-family:inherit;}{\textbf{not}}\style{font-family:inherit;}{\text{ differentiable at }}z_0}$ then $\color{red}{f\style{font-family:inherit;}{\text{ is }}\style{font-family:inherit;}{\textbf{not}}\style{font-family:inherit;}{\text{ continuous at }}z_0}$ or $\color{blue}{g'(f(z_0))=0}$ or $\color{purple}{g\circ f\style{font-family:inherit;}{\text{ is }}\style{font-family:inherit;}{\textbf{not}}\style{font-family:inherit;}{\text{ differentiable at }}z_0}$.
If we force "$\color{purple}{g\circ f\style{font-family:inherit;}{\text{ is differentiable at }}z_0}$", then either $\color{red}{f\style{font-family:inherit;}{\text{ is }}\style{font-family:inherit;}{\textbf{not}}\style{font-family:inherit;}{\text{ continuous at }}z_0}$ or $\color{blue}{g'(f(z_0))=0}$.
An easy way to make that or statement happen is if $g$ is a constant function so that $g'(f(z_0))=0$. But what about other choices of $g$?
Answer
Yes, $g\circ f$ can be differentiable at a point even if $f$ is not. For instance, suppose $g(z)=z^2$ so that $g'(0)=2*0=0$. And suppose that $f(a+bi)=\begin{cases}
0 & \text{ if }a,b\in\mathbb{Q}\\
a+bi & \text{ if }a,b\notin\mathbb{Q}
\end{cases}$. Then $g\circ f$ is differentiable at $0$ even though $f$ is not differentiable anywhere.
