TITLE: The Cauchy–Riemann equations and analyticity
QUESTION [14 upvotes]: I would be interested to learn if the following generalization of the classical Looman-Menchoff theorem is true. 

Assume that the function $f=u+iv$, defined on a domain $D\subset\mathbb{C}$, is such that 

$u_x$, $u_y$, $v_x$, $v_y$ exist almost everywhere in $D$.
$u$, $v$ satisfy the Cauchy–Riemann equations almost everywhere in $D$.
$f=f(x,y)$ is separately continuous (in $x$ and $y$) in $D$.
$f$ is locally integrable.


Question: Does it follow that $f$ is analytic everywhere in $D$?


Remark 1. Condition 3 is essential (take $f=1/z$).
Remark 2. G. Sindalovskiĭ proved analyticity of $f$ under conditions 2-4 when the partial derivatives exist everywhere in $D$, except on a countable union of closed sets of finite linear Hausdorff measure (link).

REPLY [24 votes]: No.
Let $c$ be the Cantor function on $[0,1]$, so that $c$ is continuous, $c' = 0$ a.e., but $c$ is not constant.  Then take $u(x+iy) = v(x+iy)=c(x)c(y)$.  We have $u_x=u_y=v_x=v_y=0$ a.e. so the Cauchy–Riemann equations are trivially satisfied, and $f(z)=u(z)+iv(z)$ is bounded and continuous on the unit square, but certainly not analytic.
Almost everywhere differentiability is almost never the right condition for solutions to a PDE.  A better condition would be to have $u,v$ in some Sobolev space.