Show that the absolute value of this function is twice differentiable except on a set of Lebesgue measure $0$ Let


*

*$f\in C^3(\mathbb R)$ with $f>0$ and $$\int f(x)\:{\rm d}x=1\tag1$$

*$g:=\ln f$ and assume that $g'=\frac{f'}f$ is Lipschitz continuous (note that this implies that $f'(x)\xrightarrow{|x|\to\infty}0$)

*$n\in\mathbb N$, $x\in\mathbb R^n$, $$s(z_1,y_2,\ldots,y_n):=g(x_1+c_nz_1)-g(x_1)+\sum_{i=2}^n(g(y_i)-g(x_i))\;\;\;\text{for }z_1,y_2,\ldots,y_n\in\mathbb R$$ for some $c_n>0$ and $$h(z_1,y_2,\ldots,y_n):=e^{s(z_1,\:y_2,\:\ldots\:,\:y_n)}-1=\frac{f(x_1+c_nz_1)}{f(x_1)}\prod_{i=2}^n\frac{f(y_i)}{f(x_i)}-1\;\;\;\text{for }z_1,y_2,\ldots,y_n\in\mathbb R$$

For an arbitrary differentiable $\tilde h:\mathbb R\to\mathbb R$, we're able to show that $$N:=\left\{a\in\mathbb R:\tilde h(a)=0\text{ and }\tilde h'(a)\ne0\right\}$$ is countable and $|\tilde h|$ is differentiable on $\mathbb R\setminus N$ with $$|\tilde h|'(x)=\begin{cases}\displaystyle\frac{\tilde h(a)}{\left|\tilde h(a)\right|}\tilde h'(a)&\text{, if }\tilde h(a)\ne0\\0&\text{, if }\tilde h(a)=0\text{ and }\tilde h'(a)=0\end{cases}\tag2$$ for all $a\in\mathbb R$. So, an analogous result can be shown for the partial derivative of $h$ with respect to $z_1$. Are we even able to show that there is a Borel measurable $N'\subseteq\mathbb R^n$ with Lebesgue measure $0$ such that $|h|$ is twice partially differentiable with respect to $z_1$ on $\mathbb R^n\setminus N'$?

Feel free to assume that $c_n$ is decreasing in $n$ with $c_n\xrightarrow{n\to\infty}0$ and that $n$ is as large as you like.
EDIT: Let me note that the assumptions yield the following properties of $f$, which might be useful (let $c$ denote the Lipschitz constant of $g'$):


*

*$g(y)-g(x)-g'(x)(y-x)\ge-\frac c2|y-x|^2$ for all $x,y\in\mathbb R$

*$f(y)\ge f(x)e^{\frac{|g'(x)|^2}{2c}}e^{-\frac c2\left|y-x-\frac{g'(x)}c\right|^2}\ge f(x)e^{-\frac c2\left|y-x-\frac{g'(x)}c\right|^2}$ for all $x,y\in\mathbb R$

*$f(x)\le\sqrt{\frac c{2\pi}}e^{-\frac{|g'(x)|^2}{2c}}\le\sqrt{\frac c{2\pi}}$ for all $x\in\mathbb R$

*$f$ is Lipschitz continuous with constant $\frac c{\sqrt{2\pi e}}$
 A: Let $h:\mathbb R\rightarrow \mathbb R$ continuous such that the second distribution derivative $h''$ is continuous and bounded. We define
$$
\rho(x)=\vert{h(x)}\vert^{\frac{1}{2}}+\vert{h'(x)}\vert,
$$
so that
$
\vert{h^{(j)}(x)}\vert\le \rho(x)^{2-j}\quad \text{for $0\le j\le 1$}.
$
We define as well the open set
$$
\Omega=\{x\in \mathbb R, \rho(x) >0\}.
$$
Then there exist positive constants $r, C$ such that
$$
x\in \Omega, \vert{y-x}\vert\le r\rho(x)\Longrightarrow y\in \Omega, C^{-1}\le \frac{\rho(y)}{\rho(x)}\le C.
\tag{$\ast$}$$ 
As a result, we can construct a (Calder\'on-Zygmund) partition of unity $\mathbf 1_\Omega=\sum_{\nu\in \mathbb N}\chi_\nu(x)$ with $\chi_\nu\in C^\infty_c(\Omega)$ and $\text{supp}\chi_\nu\subset B(x_\nu, r\rho(x_\nu))$ with each $x_\nu\in \Omega$,
$$\forall j\in \{0,1\},\quad
\sup_{\nu,x}\rho(x_\nu)^{j}\vert \chi_\nu^{(j)}(x)\vert\le C_j<+\infty. 
$$
You get that
$
h(x)=\sum_\nu h(x) \chi_\nu(x)
$
and each function $h_\nu=\chi_\nu h$ has a normal form depending on which term in the definition of $\rho$ is dominant.


*

*If $h^{1/2}$ is dominant, then $h_\nu(x)$ behaves as $\pm\rho_\nu^2 \phi(x/\rho_\nu)$ and thus $\vert h_\nu\vert$ behaves as $\rho_\nu^2 \phi(x/\rho_\nu)$ which is twice differentiable.

*If $h^{1/2}$ is not dominant but $\vert h'\vert$ is dominant, then $h_\nu(x)$ behaves as 
$\rho_\nu(x-x_\nu)$ and thus $\vert h_\nu\vert$ behaves as
$\rho_\nu\vert x-x_\nu\vert$, thus is twice differentiable except at $x_\nu$.
Of course, you have to prove $(\ast)$, the existence of a partition of unity and justify the discussion on normal forms with 1,2. My point with that answer is that it describes an example of a Calder\'on-Zygmund decomposition, a tool which looks suitable for this type of problem.
