This is a problem from Schilling's Brownian Motion.
Let $(B_t,\mathscr{F}_t)_{t\ge 0}$ be a one-dimensional Brownian motion and $\tau$ a stopping time. Find $\langle B^\tau \rangle _t .$
Below is the solution given. But, I believe there are some errors to the solution below. So we want to show that $B_{t\wedge \tau}^2 - t\wedge \tau$ is a martingale.Then, what we need at the end is $\int_F B_{\tau \wedge s}^2 - \tau \wedge s dP = \int_F B_{\tau \wedge t}^2 - \tau \wedge t dP$ for all $F \in \mathscr{F}_s$. But the solution below shows $\int_F B_{\tau \wedge s}dP=\int_F B_{\tau \wedge t}dP$. How can I fix this problem?
Consider the sequence of discrete stopping times $$\tau_m := \frac{\lfloor 2^m \tau\rfloor + 1}{2^m} \wedge T. $$

First, I believe that the almost sure and $L^1$ convergences should be to $B^2$ and not $B$ in the statement. In any case you can prove always by dominated convergence, that:
$$ B^2_{\tau_m \wedge t} - \tau_m \wedge t \longrightarrow B^2_{\tau \wedge t} - \tau \wedge t $$
Both almost surely and in $L^1.$ Then the last argument shows that $(B^2_{\tau \wedge t} - \tau \wedge t)_{t \ge 0}$ is a martingale.