Let $f \colon U \to \mathbb{R}$ be a twice differentiable function, where $U$ is an open subset of $\mathbb{R}^n$. Here twice differentiable means that all the second partial derivatives $\frac{\partial}{\partial x\_i} (\frac{\partial}{\partial x\_j} f)$ exist (however they are not necessarily continuous). Suppose $\Delta f = 0$, i.e. $\sum\_{i=1}^n \frac{\partial^2}{\partial x\_i^2} f = 0$. Does this imply that $f$ is harmonic, i.e. that $f$ is twice continuously differentiable? (For $n = 1$ it does, so let's assume that $n \ge 2$.)


Remark: I have read somewhere that if $f$ is weakly harmonic, then it is harmonic. However I think the second derivatives of $f$ here are not necessarily the same as the weak second derivatives. So my guess is that there is a counterexample, but I was not able to find one. Such a counterexample would be an obstruction to the extension of the Lebesgue integral to more general functions, such that the Fubini theorem and the Newton-Leibniz theorem both remain true.



Nonharmonic solutions of Laplace's equation
Here's a counterexample in $n\ge3$ dimensions. With $\lVert\cdot\rVert$ denoting the Euclidean norm, set
$$
f(x)=\begin{cases}
x\_1x\_2x\_3\lVert x\rVert^{-n-4},&{\rm if\ }x\not=0,\cr
0,&{\rm if\ }x=0.
\end{cases}
$$
This is harmonic on $x\not=0$, has first and second order derivatives at the origin, but $f$ along with all its derivatives are discontinuous at the origin.


Note that, $f=c\frac{\partial^3(\lVert x\rVert^{-n+2})}{\partial x\_1\partial x\_2\partial x\_3}$ is a third order derivative of a harmonic function, so is harmonic (away from the origin). As $f$ vanishes whenever all but two coordinates are zero, it along with its first order derivatives all vanish on the coordinate axes. So, $f$ along with all its first and second order derivatives vanish at the origin.


Next, here's a counterexample in $n=2$ dimensions. Using $i=\sqrt{-1}$, define $f\colon\mathbb{R}^2\to\mathbb{R}$ by,
$$
f(x,y)=\begin{cases}
\Re\left[\exp\left(-(x+iy)^{-4}\right)\right],&{\rm if\ }(x,y)\not=0,\cr
0,&{\rm if\ }x=y=0.
\end{cases}
$$
As the real part of an analytic function, $f$ is harmonic away from the origin. Also, $f$ along with its derivatives to any order are bounded by a multiple of a power of $\lVert x\rVert$ mutiplied by $\exp(-\lVert x\rVert^{-4})$ on any bounded subset of the coordinate axes (outside of the origin). So, $f$ together with all partial derivatives to all orders exist and are zero at the origin. On the other hand, $f$ is not continuous at the origin.
Note, this also gives an alternative counterexample to the first one above in $n\ge3$ dimensions by making $f$ independent of $x\_3,\ldots,x\_n$. 


