[proofplan]
We first check that the stopped process is adapted: stopping time measurability lets us express events involving $X_{t\wedge\tau}$ by splitting over the cases $\tau\leq t$ and $\tau>t$. Integrability is part of the hypothesis. For the martingale identity, we use bounded optional sampling with the bounded stopping time $\rho=s\vee(t\wedge\tau)$. On $\{\tau\leq s\}$ the stopped process has already stopped, while on $\{\tau>s\}$ optional sampling from $s$ to $\rho=t\wedge\tau$ supplies the martingale identity.
[/proofplan]
[step:Verify adaptedness of the stopped variables]
Fix $t\in T$. We show that $X_{t\wedge\tau}$ is $\mathcal F_t$-measurable. Let $B$ be a Borel subset of $\mathbb R$. In discrete time,
\begin{align*}
\{X_{t\wedge\tau}\in B\}
&=
\left(\bigcup_{k\leq t} \{\tau=k\}\cap\{X_k\in B\}\right)
\cup
\left(\{\tau>t\}\cap\{X_t\in B\}\right).
\end{align*}
Here $\{\tau=k\}\in\mathcal F_k\subseteq\mathcal F_t$, $\{X_k\in B\}\in\mathcal F_k\subseteq\mathcal F_t$, $\{\tau>t\}=\{\tau\leq t\}^c\in\mathcal F_t$, and $\{X_t\in B\}\in\mathcal F_t$. Hence the displayed event belongs to $\mathcal F_t$.
In the right-continuous continuous-time case, define for each integer $m\geq 1$ the dyadic rounding
\begin{align*}
\theta_m &= 2^{-m}\left\lceil 2^m(t\wedge\tau)\right\rceil.
\end{align*}
Then $\theta_m$ takes countably many dyadic values, satisfies $t\wedge\tau\leq\theta_m\leq t+2^{-m}$, and is a stopping time because for every dyadic $r$,
\begin{align*}
\{\theta_m\leq r\} &= \{t\wedge\tau\leq r\}\in\mathcal F_r.
\end{align*}
For fixed $m$, the random variable $X_{\theta_m}$ is $\mathcal F_{t+2^{-m}}$-measurable by the discrete-valued stopping-time decomposition
\begin{align*}
\{X_{\theta_m}\in B\}
&=
\bigcup_{\substack{r\in 2^{-m}\mathbb Z_{\geq 0}\\ r\leq t+2^{-m}}}
\{\theta_m=r\}\cap\{X_r\in B\}.
\end{align*}
Since $\theta_m\downarrow t\wedge\tau$ and the paths of $X$ are right-continuous, $X_{\theta_m}\to X_{t\wedge\tau}$ almost surely. For every $\varepsilon>0$, all sufficiently large $m$ satisfy $t+2^{-m}<t+\varepsilon$, so the limit $X_{t\wedge\tau}$ is $\mathcal F_{t+\varepsilon}$-measurable. Right-continuity of the filtration gives
\begin{align*}
\mathcal F_t &= \bigcap_{\varepsilon>0}\mathcal F_{t+\varepsilon},
\end{align*}
and hence $X_{t\wedge\tau}$ is $\mathcal F_t$-measurable.
[/step]
[step:Apply optional sampling after separating the already stopped event]
Let $s,t\in T$ with $s\leq t$. Define two stopping times
\begin{align*}
\rho &= s\vee(t\wedge\tau), &
E &= \{\tau\leq s\}.
\end{align*}
The set $E$ belongs to $\mathcal F_s$ because $\tau$ is a stopping time. The random time $\rho$ is a stopping time, satisfies $s\leq \rho\leq t$, equals $s$ on $E$, and equals $t\wedge\tau$ on $E^c=\{\tau>s\}$.
In discrete time, the [Optional Stopping Theorem](/theorems/1153) applied to the deterministic stopping time $s$ and the bounded stopping time $\rho$ gives
\begin{align*}
\mathbb E[X_{\rho}\mid\mathcal F_s] &= X_s
\end{align*}
almost surely. In the right-continuous continuous-time case, the bounded optional sampling theorem for right-continuous martingales is the continuous-time analogue of the same bounded stopping theorem. Its hypotheses are met because $s$ and $\rho$ are bounded stopping times, $s\leq\rho\leq t$, and $X_\rho=X_s\mathbb 1_E+X_{t\wedge\tau}\mathbb 1_{E^c}$ is integrable by integrability of $X_s$ and $X_{t\wedge\tau}$.
Using the decomposition $X_\rho=X_s\mathbb 1_E+X_{t\wedge\tau}\mathbb 1_{E^c}$ and the fact that $E\in\mathcal F_s$, we get
\begin{align*}
\mathbb E[X_{t\wedge\tau}\mathbb 1_{E^c}\mid\mathcal F_s]
&= X_s\mathbb 1_{E^c}.
\end{align*}
[/step]
[step:Combine the already stopped part with the optional sampling part]
On the event $E=\{\tau\leq s\}$, we have $t\wedge\tau=s\wedge\tau=\tau$. The random variable $X_{s\wedge\tau}$ is $\mathcal F_s$-measurable by the adaptedness step, so $X_{t\wedge\tau}\mathbb 1_E=X_{s\wedge\tau}\mathbb 1_E$ is $\mathcal F_s$-measurable. Therefore
\begin{align*}
\mathbb E[X_{t\wedge\tau}\mathbb 1_E\mid\mathcal F_s]
&= X_{s\wedge\tau}\mathbb 1_E.
\end{align*}
Combining this identity with the identity from the preceding step gives
\begin{align*}
\mathbb E[X_{t\wedge\tau}\mid\mathcal F_s]
&= \mathbb E[X_{t\wedge\tau}\mathbb 1_E\mid\mathcal F_s]
+ \mathbb E[X_{t\wedge\tau}\mathbb 1_{E^c}\mid\mathcal F_s] \\
&= X_{s\wedge\tau}\mathbb 1_E + X_s\mathbb 1_{E^c} \\
&= X_{s\wedge\tau}
\end{align*}
almost surely, because $s\wedge\tau=s$ on $E^c$.
[/step]
[step:Conclude the stopped process is a martingale]
By hypothesis, $X_{t\wedge\tau}$ is integrable for every $t\in T$. The first step proves adaptedness, and the preceding conditional expectation identity gives
\begin{align*}
\mathbb E[X_{t\wedge\tau}\mid\mathcal F_s] &= X_{s\wedge\tau}
\end{align*}
almost surely whenever $s\leq t$. Hence $(X_{t\wedge\tau})_{t\in T}$ is a martingale with respect to $(\mathcal F_t)_{t\in T}$.
[/step]