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.