Since $f(t,B_t)$ is a martingale, it follows from well-known martingale representation theorems (see e.g. [1]) that we can write
$$f(t,B_t) = f(0,B_0) + \int_0^t X_s \, dB_s$$
for some progressively measurable process $X$. A very useful tool to identify $X$ is the Malliavin derivative. One of the key properties of the Malliavin derivative $D$ is that
$$D \left( \int_0^t X_s \, dB_s \right) = X_t \tag{1}$$
On the other hand, the Malliavin derivative also satisfies a chain rule and we get
$$Df(t,B_t) = f'(t,B_t).$$
Combining both equations we get $X_t = f'(t,B_t)$ almost surely. If you are interested in these kind of things, then take a look at [2,3]; of particular interest (for your question) is the Clark Ocone representation formula.
[1] R.S. Schilling, L. Partzsch: Brownian motion - An Introduction to Stochastic Processes. (De Gruyter)
[2] D. Nualart: The Malliavin Calculus and Related Topics (Springer)
[3] I. Nourdin, G. Peccati: From Stein's Method to Universality. (Cambridge)
Remark: Under slightly stronger assumptions we don't need all the fancy tools. Assume that we know that $f(s+t,x+B_t)_{t \geq 0}$ is a martingale for any fixed $s \geq 0$ and $x \in \mathbb{R}$, and assume that $f$ grows at most sub-exponentially. Then we have by the martingale property
$$f(s,x) = \mathbb{E}(f(s+t,x+B_t)).$$
If we denote by $p_t$ the density of $B_t$, then
$$f(s,x) = \int_{\mathbb{R}} f(s+t,x+y) p_t(y) \, dy = \int_{\mathbb{R}} f(s+t,z) p_t(z-x) \, dz.$$
Since the density $p_t$ is smooth, we can deduce easily that $x \mapsto f(s,x)$ is smooth and therefore we can apply Itô's formula to deduce that
$$f(t,B_t) = f(0,B_0) + \int_0^t f'(s,B_s) \, dB_s.$$