Solution (source code)

= Solution

The heat-semigroup form is $U(t,x)=P_{1-t}(f^2)(x)$. For $s<t$, independence and additivity of Brownian increments give
$$
\begin{aligned}
\mathbb E[U(t,W_t)\mid\mathcal F_s^W]
&=\mathbb E[f(W_t+B_{1-t})^2\mid\mathcal F_s^W]\\
&=\mathbb E[f(W_s+\widetilde B_{1-s})^2\mid\mathcal F_s^W]\\
&=U(s,W_s),
\end{aligned}
$$
where $\widetilde B_{1-s}$ is an independent $N(0,1-s)$ increment. Thus $M_t=U(t,W_t)$ is a <martingale>.