Let $\tau \geq 0$ be a stopping time, $\mathbb{E} \tau<\infty$. (b) Based on the identity $$ \left|X_{\tau \wedge n}-X_0\right|=\left|\sum_{k=1}^n\left(X_k-X_{k-1}\right) \cdot \mathbf{1}\{\tau \geq k\}\right| \leq \sum_{k=1}^{\infty}\left|X_k-X_{k-1}\right| \cdot \mathbf{1}\{\tau \geq k\} $$ and the proof of Doob's Optional Stopping Theorem, part (iii), show the following: If $X$ is a supermartingale for which there exists a $C \in \mathbb{R}$ with $$ \mathbb{E}\left(\left|X_k-X_{k-1}\right| \mid \mathcal{F}_{k-1}\right) \leq C \quad \forall k>0, \text { a.s. }, $$ then $\mathbb{E} X_\tau \leq \mathbb{E} X_0$. Of course we have equality in case $X$ is a martingale.
Could someone verify if I have the right idea for this solution:
$\textbf{b)}$ From the tower rule $$\mathbb{E}\left(\left|X_k-X_{k-1}\right| \mid \mathcal{F}_{k-1}\right) \leq C \implies \mathbb{E}\left(\left|X_k-X_{k-1} \right|\right) \leq \mathbb{E}\left(C \right)= C.$$ $$\left|X_{\tau \wedge n}-X_0\right|=\left|\sum_{k=1}^{\tau \wedge n}\left(X_k-X_{k-1}\right) \cdot \mathbf{1}\{\tau \geq k\}\right| \leq \sum_{k=1}^{\tau \wedge n}\left|X_k-X_{k-1}\right|$$
$$\mathbb{E} \left( \sum_{k=1}^{\tau \wedge n}\left|X_k-X_{k-1}\right| \right) = \sum_{k=1}^{\tau \wedge n} \mathbb{E} \left( \left|X_k-X_{k-1}\right| \right) \leq (\tau \wedge n) \cdot C$$ $\left|X_{\tau \wedge n}-X_0\right|$ is bounded by an integrable function (a constant function where the measure is finite) and so we can use dominated convergence:
$$0 \geq \lim _{n \rightarrow \infty} \mathbb{E}\left(X_{T \wedge n}-X_0\right)=\mathbb{E} X_\tau-\mathbb{E} X_0$$
I've seen other solutions where they take the expectation of the inequality including the indicator function but would I be right in that $$\sum_{k=1}^{n}\left|X_k-X_{k-1}\right| \cdot \mathbf{1}\{\tau \geq k\} \leq \sum_{k=1}^{n}\left|X_k-X_{k-1}\right|$$?
The stopping time $\tau$ shouldn't be outside the expectation (as you have it in the third displayed formula of b).) Rather use $$ \Bbb E\left(|X_k-X_{k-1}|\cdot 1_{\{\tau\ge k\}}\right) =\Bbb E\left(\Bbb E\left(|X_k-X_{k-1}|\mid\mathcal F_{k-1}\right)\cdot 1_{\{\tau\ge k\}}\right)\le C\Bbb P[\tau\ge k], $$ because $\{\tau\ge k\}=\{\tau\le k-1\}^c$ for $k\ge 1$. Now use the tail-sum formula $\Bbb E[\tau]=\sum_{k\ge 1}\Bbb P[\tau\ge k]$.