For fixed $k \in \mathbb{N}$ define a bounded stopping time $\tau_k$ by
$$\tau_k := \inf\{t \geq 0; M_t > x \} \wedge k = \tau \wedge k.$$
Then, by the optional stopping theorem, we have
$$\mathbb{E}(M_{\tau_k} \mid \mathcal{F}_0) = M_0. \tag{1}$$
On the other hand, since $(M_t)_{t \geq 0}$ is a continuous martingale, we know that
$$M_{\tau_k} = \begin{cases} x 1_{\{\tau<k\}} + M_{k} 1_{\{\tau \geq k\}}, & M_0 \leq x, \\ M_0, & M_0>x \end{cases}. \tag{2}$$
Combining $(1)$ and $(2)$ yields
$$M_0 1_{\{M_0>x\}} + 1_{\{M_0 \leq x\}} x \mathbb{P}(\tau < k \mid \mathcal{F}_0) + \mathbb{E}(M_k 1_{\{\tau \geq k\}} \mid \mathcal{F}_0) = M_0.$$
Finally, the claim follows by letting $k \to \infty$. (For the second term use monotone convergence, for the third one dominated convergence and the fact that $M_k \to 0$ as $k \to \infty$.)
In general, the family of random variables $(S_T)_T$ fails to be uniformly integrable. Let's introduce the following definitions:
Definition Let $(X_t)_{t \geq 0}$ be a jointly measurable stochastic process. If the family $$\{X_{\tau}; \tau < \infty \, \, \text{stopping time}\}$$ is uniformly integrable, then we say that $(X_t)_{t \geq 0}$ is of class (D). If $$\{X_{\tau}; \tau \leq M \, \, \text{stopping time}\}$$ is uniformly integrable for any constant $M>0$, then $(X_t)_{t \geq 0}$ is of class (DL).
As you already pointed out, any uniformly integrable martingale with càdlàg sample paths is of class (D). Let me mention that these notions play an important role for the Doob-Meyer decomposition of (sub)martingales.
For submartingales there is the following statement (see Lemma 5 here):
Lemma A càdlàg submartingale is of class (DL) if and only if its negative part is of class (DL).
In particular, any non-negative càdlàg submartingale is of class (DL). Moreover, one can show the following statement (see Lemma 4):
Lemma: A non-negative càdlàg submartingale is of class (D) if, and only if, it is uniformly integrable.
The equivalence does, in general, not hold if we drop the assumption of non-negativity.
Example Let $(B_t)_{t \geq 0}$ be a three-dimensional Brownian motion started at $B_0 =( 1,0,0)$. If we set $u(x) := \frac{1}{|x|}$, then $M_t := u(B_t)$ is a non-negative supermartingale. Note that $(M_t)_{t \geq 0}$ has continuous sample paths with probability 1 since $$\mathbb{P}(\exists t>0: B_t=0)=0$$ (recall that $(B_t)_t$ is a three-dimensional Brownian motion; in dimension $d=1$ this statement is plainly wrong). It is possible to show that $(M_t)_{t \geq 0}$ is uniformly integrable but not of class (D), see the very end of the paper (1). Consequently, the process
$$N_t := -M_t$$
is a uniformly integrable submartingale which is not of class (D).
There is the following equivalent characterization (see Chapter 2 in (2)):
Theorem: Let $(X_t)_{t \geq 0}$ be a right-continuous submartingale. Then:
- $(X_t)_{t \geq 0}$ is of class (DL) if, and only if, there exists a right-continuous martingale $(M_t)_{t \geq 0}$ and a non-decreasing predictable process $(A_t)_{t \geq 0}$ such that $X=M+A$.
- $(X_t)_{t \geq 0}$ is of class (D) if, and only if, it admits a Doob-Meyer decomposition $X=M+A$ for a uniformly integrable right-continuous martingale $(M_t)_{t \geq 0}$ and a non-decreasing predictable uniformly integrable process $(A_t)_{t \geq 0}$.
Reference
(1) Johnson, G., Helms, L.L.: Class D Supermartingales. Bull. Am. Math. Soc. 69 (1963), 59-62. (PDF)
(2) Yeh, J.: Martingales and Stochastic Analysis. World Scientific, 1995.
Best Answer
The absolute value of this martingale is actually not necessarily uniformly bounded; think of a 1-D simple random walk starting from 0. Under your stopping time, it could go all the way to negative infinity without being stopped.
Edit: After reading your comment that it is non-negative, it seems your assumptions themselves are contradictory to begin with. The only non-negative martingale starting from 0 can be, well, just 0. (i.e. $X_n = 0$ a.s.). Otherwise, you cannot have $\mathbb{E}X_n = 0$ if $X_n \geq 0$. As such, you are never going to reach K for K > 0.