Does there exist a complex function which is differentiable at one point and nowhere else continuous?

Let $f\colon\mathbb{C}\to\mathbb{C}$. We know that if $f^{\prime}(a)$ exists for some $a\in\mathbb{C}$ then $f$ is continuous at $a$. This is because, from the definition of the derivative, $$f(z)-f(a)=[f^{\prime}(a)+\varepsilon(z)](z-a)$$ for some $\varepsilon$ such that $\varepsilon(z)\to0$ as $z\to a$, and hence $f(z)\to f(a)$.

I think we can interpret this geometrically by saying that, for $z$ close to $a$, if we take the vector from $a$ to $z$, rotate it counterclockwise about its tail by $\mathrm{Arg}\,{(f^{\prime}(a))}$ and scale its length by $\lvert f^{\prime}(a)\rvert$, then we get approximately the vector from $f(a)$ to $f(z)$ (it's only approximate, because of the $\varepsilon$ error term, but for $z$ close to $a$ this $\varepsilon$ is small).

However, consider the following heuristic argument: let $z_{1}$ and $z_{2}$ both be "close to" $a$ (and therefore close to each other). The above interpretation then suggests that the vector from $f(a)$ to $f(z_{1})$ should be approximately the same as the vector from $f(a)$ to $f(z_{2})$, and therefore $f(z_{2})-f(z_{1})$ should be small in magnitude. This seems to suggest that $f$ should be continuous not just at $a$, but also in some small interval around $a$. This seems too good to be true.

Hence my question:

Does there exist a function $f\colon\mathbb{C}\to\mathbb{C}$ such that $f^{\prime}(a)$ exists at some point $a\in\mathbb{C}$ but $f$ is continuous nowhere else?


Update, added later: A quick thanks to those who responded. I have since thought through this with a friend and we've found a problem with the heuristic argument:

Properly interpreted, the heuristic argument is saying that if $z_{1}$ and $z_{2}$ are close to $a$, then $f(z_{1})$ is close to $f(z_{2})$. However, to have continuity at $z_{1}$, say, we need to be able to make $f(z_{2})$ arbitrarily close to $f(z_{1})$ by choosing $z_{2}$ to be sufficiently close to $z_{1}$ --- therein lies the problem. Suppose $\lvert z_{3}-z_{1} \rvert < \lvert z_{2}-z_{1} \rvert$, i.e., suppose $z_{3}$ is even closer to $z_{1}$ than $z_{2}$ is. Then, for $f$ to be continuous, we need to be able to ensure that $f(z_{3})$ is closer still to $f(z_{1})$ (than $f(z_{2})$ is); in general, we can't ensure this.

If I get round to it, I might try to work through the details in a specific case and see if there are any other problems. If I get anywhere, I'll post the results as an additional answer.


Let $g \colon \mathbb{C} \rightarrow \mathbb{C}$ be a function that is discontinuous everywhere and bounded. Consider $f(z) := z^2 g(z)$. Then $f$ is continuous only at $z = 0$, and $f$ is differentiable at $z = 0$ as

$$ \lim_{z \to 0} \frac{f(z) - f(0)}{z} = \lim_{z \to 0} z g(z) = 0.$$


Consider $f(z)=|z|^2\cdot \mathbf 1_{\Bbb Q[i]}(z)$