Solution (source code)

= Solution

The <Itô formula> decomposes the smooth transform into a <continuous local martingale> and a <finite-variation process>:
$$
f(M_t)-f(0)=N_t+\frac12\int_0^tf''(M_s)\,d[M]_s,
\qquad N_t=\int_0^tf'(M_s)\,dM_s.
$$
If $f(M)$ has <finite variation>, then $N$ also has <finite variation>. A <continuous finite-variation local martingale is constant>, so $N=0$ and
$$
0=[N]_t=\int_0^tf'(M_s)^2\,d[M]_s.
$$
It remains to show that the second-order term vanishes; the preceding observation alone does not establish this.

Let $Z=\{a:f'(a)=0\}$. By the <occupation-times formula> for the <local time of a semimartingale>,
$$
0=\int_{\mathbb R}f'(a)^2L_t^a(M)\,da.
$$
Therefore $L_t^a(M)=0$ for almost every $a\notin Z$. Also $f''(a)=0$ for almost every $a\in Z$: if $f'(a)=0$ and $f''(a)\ne0$, continuity of $f''$ makes $f'$ strictly monotone in a neighborhood of $a$, so that zero is isolated. Such isolated zeros form a countable <set>. Localizing to bounded paths and finite <quadratic variation>, then using the <occupation-times formula> once more, gives
$$
\int_0^t|f''(M_s)|\,d[M]_s
=\int_{\mathbb R}|f''(a)|L_t^a(M)\,da=0.
$$
Both terms in the <Itô formula> now vanish. Apply this on all rational times and use continuity to obtain the simultaneous conclusion
$$
\boxed{f(M_t)=f(0)\quad\text{for every }t\geq0\text{ almost surely}.}
$$
This is the <finite-variation smooth transform of a continuous local martingale> property.