Here is my story, I have the following function :
$ g(x)=(1+x)\cdot\exp\left(-\frac{(\log(x+a)+c)^2}{2\sigma^2}\right)1[x\ge y]=f(x)\cdot1[x\ge y] $
with $a,c,\sigma$ being "good" reals so that $g$ stays well defined and let $X_t$ be a geometric Brownian motion.
Here function $g$ is neither a convex function nor a difference of two convex functions because of the indicator function at $x=y$ where continuity is badly broken.
An "illegal" move then is to apply blindly Itô-Tanaka formula to $g(X_T)$ and get : $ g(X_T)=g(X_0) +\int_0^T D^-g(X_t)dX_t+ \int_{\mathbb{R}}\Lambda_T(a)\mu(da) $
Where $D^-$ is the left derivtive operator and $\mu$ is the "second derivative measure" (see for example theorem 7.1 page 218 in Karatzas and Shreve's book "Brownian Motion and Stochastic calculus").
Following this formula blindly I would get (weakly) :
D^-g(x)=f'(x)\cdot1[x>y]+f(y)\cdot\delta_y(x)
Now getting $\mu$ seems to formally go like:
\mu(dx)=f''(x)\cdot1[x\ge y]dx+f'(y)\cdot\delta_y(dx) +f(y)(\delta_y)'(dx)
So we get at the (probably wrong but appealing) formula : \begin{align} g(X_T)&=g(X_0)+\int_0^T \left(f'(X_t)\cdot 1[X_t\ge y]+f(y)\delta_y(X_t)\right) dX_t+\int_y^{\infty}\Lambda_T(x)f''(x)dx \\ &+f'(y)\Lambda_T(y)-f(y)\partial_y\Lambda_T(y) \end{align}
Here many terms seem to be not well defined so I was deriving a heuristic (and terribly bad) calculation only to see where it was leading to. Anyway I am now wondering what is the correct result in this case.
When I say correct I mean that would make explicit the compensator of the $g(X_t)$ process using local time, because in the end I would like to take the expectation of $g(X_t)$, get rid of the local martingale parts and get the expectation of $g(X_t)$ in the form of the expectation of the compensator expressed in local time of $X_t$ + $g(X_0)$.
Best regards
PS: here the function $f$ was chosen as it seemed simple enough to be Itô differentiable but with reasonable properties so that expectation might exists.