Show that $f(B_t)$ is a martingale iff $f(x)=a+bx$. One question from Durrett's 5th Probability textbook is the following. Suppose that $f\in C^2$. Show that $f(B_t)$ is a martingale iff $f(x)=a+bx$.
For "$\Leftarrow$" direction, if $f(x)=a+bx$, then for s<t
$$
E[f(B_t)|\mathcal{F}_s]=E[a+bB_t|\mathcal{F}_s]=a+bB_s
$$
For "$\Rightarrow$" direction, I want to use the Martingale representation theorem that if $M_t$ is a martingale and $M_t\in L^2$, then there exists a unique stochastic process $g(s,\omega)$ s.t.
$$
M_t=EM_0+\int_0^tg(s,\omega)dB(s)
$$
is a martingale w.r.t. $\mathcal{F}_t$.
It suffices to take the derivative of $f$ that
$$
df(B_t)=f'(B_t)dB_t+\frac{1}{2}f''(B_t)dt
$$
Then
$$
f(B_t)=f(0)+\int_0^tf'(B_s)dB_s+\frac{1}{2}\int_0^tf''(B_s)ds
$$
Can we get $f''(B_s)=0$ from the martingale representation theorem? That implies $f=a+bx$?
 A: Your solution for the backwards direction is correct. For the forward direction, it's best to use Itô's formula instead of the martingale representation theorem.
To show the forward direction, assume $X_t = f(B_t)$ is a martingale and apply Itô's lemma to get:
$$dX_t = f_x(B_t) dB_t + \frac{1}{2}f_{xx}(B_t)dt$$
Since $X_t$ is a martingale, it must be driftless (i.e. the $dt$ term must be zero), which implies that $f_{xx}=0$. Integrating twice yields that $f(x) = a +bx$, as desired.
A: We have by Itô's formula [1; (25.10)] $$X_t=X_0+\int_0^t f'(B_s)\,\mathrm dB_s+\frac 12\int_0^t f''(B_s)\,\mathrm ds.$$ By [1; Satz 25.18], since $\mathsf E\left(\int_0^T f'(B_s)^2\,\mathrm ds\right)<\infty$ for all $T\in[0,\infty[$ (exercise: prove this!), we have that $t\mapsto\int_0^t f'(B_s)\,\mathrm dB_s$ is a continuous martingale on $[0,\infty[$. Therefore, $t\mapsto\int_0^t f''(B_s)\,\mathrm ds$ must also be a continuous martingale on $[0,\infty[$ (exercise: prove this!).
Lemma. The stochastic process $t\mapsto \int_0^t f''(B_s)\,\mathrm ds$ has almost surely finite local variation.
Since a continuous martingale with almost surely finite local variation is almost surely constant ([1; Korollar 21.72]), we may thus conclude with the help of the Lemma that $t\mapsto\int_0^t f''(B_s)\,\mathrm ds$ is constant almost surely. This implies (exercise: state why) that $f''(B_s)=0$ for all $s\in[0,\infty[$ almost surely.
Now conclude that $f''=0$ using continuity of $f''$ and the fact that the support of $B_s$ is $\mathbb R$ for all $s>0$ and thus that $f$ must be an affine function.

Proof of Lemma. Let $T>0$ and $n\in\mathbb N$. For any partition $0=t_0<t_1<\dots<t_n=T$, we have
\begin{equation*}\sum_{k=0}^{n-1} \left\lvert\int_0^{t_{k+1}} f''(B_s)\,\mathrm ds-\int_0^{t_k} f''(B_s)\,\mathrm ds\right\rvert\le\int_0^T\lvert f''(B_s)\rvert\,\mathrm ds\le T\sup_{s\in[0,T]} \lvert f''(B_s)\rvert,\end{equation*} which is almost surely finite. (Furthermore, if $t\mapsto B_t(\omega)$ is continuous for all $\omega\in\Omega$, then the local variation is finite for all $\omega\in\Omega$.) $\square$
Literature
[1] Achim Klenke, Wahrscheinlichkeitstheorie. 3. Auflage. Springer-Verlag Berlin/Heidelberg (2013).
A: Suppose $f(B_t)$ is a martingale. Let $c<0<d$ be real numbers. It's well known that if $T:=\inf\{t:B_t\notin(c,d)\}$ then
$$
P[B_T=c]={d\over d-c}.
$$
Because $f(B)$ is a martingale,
$$
f(0)=E[f(B_0)]=E[f(B_T)]=f(c){d\over d-c}+f(d){-c\over d-c}.\qquad (1)
$$
In particular (take $c=-1$)
$$
f(d) = f(0)+[f(0)-f(-1)]d,\qquad (2)
$$
for $d>0$. Likewise
$$
f(c)=f(0)+[f(1)-f(0)]c,\qquad (3)
$$
for $c<0$. Finally (take $c=-1, d=1$ in (1)):
$$
f(0)={f(-1)+f(1)\over 2}, 
$$
implying that $f(1)-f(0)=f(0)-f(-1)$.
Now (2) and (3) together imply that $f(x)=f(0)+mx$ for all $x$, where $m:=[f(-1)+f(1)]/2$.
This argument doesn't need $f\in C^2$ as a hypothesis. Indeed it works  knowing just that $f$ is Lebesgue measurable and locally bounded.
