A function that satisfies Cauchy-Riemann but is not holomorphic I'm attempting Chapter 1, Exercise 12 in Stein & Shakarchi's Complex Analysis, which is as follows:

Consider the function defined by $$f(x+iy) = \sqrt{|x||y|}$$ whenever $x, y \in \mathbb{R}$. Show that $f$ satisfies the Cauchy-Riemann equations at the origin, yet $f$ is not holomorphic at $0$. 

I think that I have solved it, but since I don't have much experience with complex analysis, I'm not sure if my argument is valid/correct:

If, for $x, y \in \mathbb{R}$, we write $$f(x+iy) = \sqrt{|x||y|} = u(x,y)$$ and $v(x,y) = 0$, since $f$ is a real-valued function, then, for $h \in \mathbb{R}$, $$\frac{\partial u}{\partial x} = \lim_{h\rightarrow 0} \frac{u(x+h,y)-u(x,y)}{h} = \lim_{h\rightarrow 0}\frac{0}{h} = 0 = \frac{\partial v}{\partial y}$$ and similarly we find that $\partial u/\partial y = 0 = -\partial v/\partial x$, so this function satisfies the Cauchy-Riemann equations.
Now, for $h = h_1 + ih_2 \in \mathbb{C}$, $$\lim_{h\rightarrow 0} \frac{f(z+h)-f(z)}{h} = \lim_{h\rightarrow 0} \frac{\sqrt{|h_1||h_2|}}{h_1+ih_2}$$ at the origin.
Suppose that $h_1 = ab = h_2$ for real numbers $a,b > 0$. Then $$\lim_{h\rightarrow 0} \frac{f(z+h)-f(z)}{h} = \lim_{ab\rightarrow 0} \frac{ab}{ab + iab} = \frac{1}{1+i}.$$ But if instead $h_1 = -ab = -h_2$, then $$\lim_{h\rightarrow 0} \frac{f(z+h)-f(z)}{h} = \lim_{ab\rightarrow 0} \frac{ab}{-ab + iab} = \frac{1}{-1+i},$$ so the limit does not exist and hence $f$ is not holomorphic at the origin.

I would greatly appreciate if somebody could check the above for correctness. (In particular, can I just assume that the $ab$ factorization exists? And is it sufficient to show that the limit is not the same by approaching from different directions?)
 A: I don't get why you used a product $ab$. It suffices to just consider the two paths where $(h_1, h_2) = (t,t)$ for $t> 0$ and $(h_1, h_2) = (t,-t)$  for $t>0$. Then, show that the limit as $t \to 0^+$ along these two directions yields different answers. So, basically, the idea of your computation is right, but the presentation seems weird.

Anyway, here's a more general overview of why your function fails to be holomorphic.
Let $U \subset \Bbb{C}$ be open and $f:U \to \Bbb{C}$ be a map. Then, $f$ is holomorphic at a point $\alpha \in U$ if and only if


*

*When you consider $\Bbb{C} = \Bbb{R}^2$, the map $f: U \subset \Bbb{R}^2 \to \Bbb{R}^2$ is $\Bbb{R}$-differentiable in the standard real-multi-variable sense, and

*$f$ satisfies the Cauchy-Riemann equations (so that the real derivative $Df_{\alpha}$ is actually a $\Bbb{C}$-linear map)


But the function $f$ you have, is $f(x,y) = (\sqrt{|xy|}, 0)$, and this is not even real-differentiable as a map from an open subset of $\Bbb{R}^2$ into $\Bbb{R}^2$. Why? Notice that $f$ is positively homogeneous, which means for every $t\geq 0$, we have $f(tx,tx) = t f(x,y)$. By this answer, if $f$ was $\Bbb{R}$-differentiable at the origin, it would have to be an $\Bbb{R}$-linear map, which it clearly isn't.

By the way, you should really take note of the statement proven in the linked answer, because it's often a quick way to prove that several functions defined on $\Bbb{R}^2$ are not $\Bbb{R}$-differentiable at the origin (for example, things like $g(x,y) = \dfrac{x^3}{x^2 + y^2}$ if $(x,y) \neq (0,0)$, and $g(0,0) = 0$ else, or other functions like this are positively homogeneous, but non-linear, hence not $\Bbb{R}$-differentiable). Once you know that theorem, the non-differentiability of such functions becomes almost obvious by inspection.
