I'm trying to answer the following question:
"Let $f: \mathbb{R}^3 \to \mathbb{R}$ be a function satisfying $\nabla^2 f =0$, then $\nabla \cdot \nabla f =0$ and $\nabla \times \nabla f =\vec 0$". If the previous statement is true, prove it. If it's false, give a counter-example.
Here I'm using the following definitions: $$ \nabla f := \frac{\partial f}{\partial x} \boldsymbol{\hat\imath} + \frac{\partial f}{\partial y} \boldsymbol{\hat\jmath} + \frac{\partial f}{\partial z}\boldsymbol{\hat k} $$ $$ \nabla^2f := \frac{\partial^2 f}{\partial^2 x} + \frac{\partial^2 f}{\partial^2 y} + \frac{\partial^2 f}{\partial^2 z} $$ $$ \nabla \times \mathbf{A} = \left(\frac{\partial A_z}{\partial y} - \frac{\partial A_y}{\partial z}\right) \boldsymbol{\hat\imath} + \left(\frac{\partial A_x}{\partial z} - \frac{\partial A_z}{\partial x}\right) \boldsymbol{\hat\jmath} + \left(\frac{\partial A_y}{\partial x} - \frac{\partial A_x}{\partial y}\right) \boldsymbol{\hat k} $$ $$ \nabla \cdot \mathbf{A} := \frac{\partial A_x}{\partial x} + \frac{\partial A_y}{\partial x} + \frac{\partial A_z}{\partial x} $$ where $\mathbf{A} := A_x \boldsymbol{\hat\imath} + A_y \boldsymbol{\hat\jmath}+ A_z\boldsymbol{\hat k}$.
Using the definitions above I've managed to show that $\nabla^2 f = \nabla \cdot \nabla f$. This covers the first part of the question.
However, while trying to expand $\nabla \times \nabla f$ I get $$ \nabla \times \nabla f = \left(\frac{\partial^2 f}{\partial y\partial z} - \frac{\partial^2 f}{\partial z\partial y}\right) \boldsymbol{\hat\imath} + \left(\frac{\partial^2 f}{\partial z\partial x} - \frac{\partial^2 f}{\partial x\partial z}\right) \boldsymbol{\hat\jmath} + \left(\frac{\partial^2 f}{\partial x\partial y} - \frac{\partial^2 f}{\partial y\partial x}\right) \boldsymbol{\hat k} $$ If I say that the mixed partials are equal, then this would conclude the proof. However, it is my understanding that the mixed partials are equal only if the function $f$ satisfies Schwarz's theorem.
My question came about because using the definitions above, I think I can have a function $f$ where the second partial derivatives exist and they add up to $0$ without the function $f$ satisfying Schwarz's theorem. This would then mean (if I understand correctly) that a counter-example to the statement could exist.
I tried modifying the function $g(x,y) = \frac{xy(x^2-y^2)}{x^2+y^2}$ if $(x,y) \neq 0$ and outputs $0$ if $(x,y) = 0$, such that the modified function $f$ would be one where $\nabla^2 f =0$. I did this because I know this function $g(x,y)$ fails Schwarz's theorem, so I thought I could use it to construct a counter-example, but the only function I could come up with was $f(x,y) =\frac{xy(x^2-y^2)}{x^2+y^2} - \frac{xy(x^2-y^2)}{x^2+y^2} = 0$, which defeated the purpose.
Does anyone know an explicit counter-example to $\nabla^2 f =0 \implies \nabla \times \nabla f =\vec 0$? Or can anyone tell me if I'm missing something that makes the statement true? Any and all help would be very much appreciated. Thank you!