Showing that a function of two brownian motions is a martingale. Let $B$ be a standard Brownian motion, let $f$ be a smooth function taking values in $[a,b]$ where $0<a<b<\infty$ and assume that the derivative $f^\prime$ is bounded. For $t\in[0,1]$ and $x\in\mathbb{R}$, let $$U(t,x)=\mathbb{E}\{f(x+B_{1-t})^2\}.$$ Let $M_t$ = $U(t,W_t)$ where $W$ is a Brownian motion independent of $B$.
I am tasked with showing that $M$ is a martingale with respect to the filtration generated by $W$. The question suggests that I should do this by "directly computing conditional expectations and the definition of Brownian motion". I am quite unsure how to do this - particularly the part regarding the filtration generated by W. Any advice would be greatly appreciated! Thank you.

Let $\{{\mathcal F}_t\}_{t \ge 0}$ denote the Brownian filtration determined by $W$ and suppose that the Brownian motion $B$ is independent of $W$. The definition of conditional expectation implies that
$$M_t={\mathbb E}[f(W_t+B_{1-t})^2 | W_t]= {\mathbb E}[f(W_t+B_{1-t})^2 |{\mathcal F}_t] \,.$$
Therefore, for $s<t$ we have
$$ {\mathbb E}[M_t |{\mathcal F}_s] ={\mathbb E}[f(W_t+B_{1-t})^2 |{\mathcal F}_s] ={\mathbb E}[f(W_s+W_t-W_s+B_{1-t})^2|{\mathcal F}_s] \,.$$
The Gaussian variable $W_t-W_s+B_{1-t}$ is independent of ${\mathcal F}_t$, and has the same $N(0,1-s)$ distribution as    $B_{1-s}$, which is also  independent of ${\mathcal F}_s$. Thus
$$ {\mathbb E}[M_t |{\mathcal F}_s] = {\mathbb E}[f(W_s+ B_{1-s})^2 |{\mathcal F}_s] =M_s\,.$$
