Here is a partial answer.
If $f\in C^2$ then we have by Ito'sItô's lemma on $f$ that for all $u$ a.s. that
$$\int_0^u f'(B_r) dB_r+\frac12\int_0^u f''(B_r) dr=\int_0^u g(B_r) dB_r+\frac12\int_0^u h(B_r) dr.$$
Rearranging yields that for all $u$
$$\int_0^u(f'(B_r)-g(B_r))dB_r=\frac12\int_0^u (h(B_r)-f''(B_r))dr.$$
Taking the quadratic variation on each side yields that for all $u$
$$\int_0^u E(f'(B_r)-g(B_r))^2dr=0,$$
given that $f'$ and $g$ are continuous this implies that $f'(B_r)=g(B_r)$ a.s. Thus we know that for all $u$
$$\int_0^u (h(B_r)-f''(B_r))dr=0,$$
implying that $h(B_r)=f''(B_r)$ a.s.
I suspect that we can prove $f\in C^2$ but I am not sure. I am unable to come up with a counterexample. Thanks for the problem.