Measurability of a stopped random variable. Assume that you ahve a stochastic process $\{X_t\}$ on the probaiblity space $(\Omega, \mathcal{F},P)$, equip this space with a filtration($\{\mathcal{F}_t\}$). And you have a random variable $\Omega\rightarrow [0, \infty]$, where the set $T^{-1}(-\infty,t]\in \mathcal{F}_t$, Then T is called a stopping time. I have two questions regarding this subject.
It is stated that it can be shown that if $X_t$ is cadlag, then it can be shown that $X_T$ is $\mathcal{F}_T$-measurable. But what does this mean? That $X_T^{-1}(B)\in \mathcal{F}_T$? The problem is that $T$ is a function of $\omega$. If I look at $X_T^{-1}(B)$, I get those $\omega$'s, such that $X_{T(\omega)}(\omega) \in B$. Now, all these $\omega$'s together is a subset of $\Omega$, but what does it mean that they are contained in $\mathcal{F}_T$? I mean $\mathcal{F}_T$ depends on $\omega$ aswell?
My second question is this: If we forget cadlag etc. Can it be shown that $X_T$ is just a random variable? The problem is showing measurability, that is, that $X_T^{-1}(B) \in \mathcal{F}$? Does this require a lot of work? Or maybe it can not be done? I've tried, but got nowhere.
 A: Given a stopping time $\tau$, we define
$$\mathcal F_\tau = \sigma\left(A\in\mathcal F_\infty: A\cap\{\tau\leqslant t\}\in \mathcal F_t,\ t\geqslant 0 \right) $$
where
$$\mathcal F_\infty = \sigma\left(\bigcup_{t\geqslant 0} \mathcal F_t\right).$$
If $X_t$ is càdlàg and adapted to $\{\mathcal F_t\}$ (i.e. when $\{\mathcal F_t\}$ is the natural filtration), then $X_t$ is progressively measurable, that is, for each $t$, the map $(t,\omega)\mapsto X_t(\omega)$ is $\mathcal B([0,t])\otimes \mathcal F_t$-measurable. For a fixed $t$, 
$$X_\tau = X_{t\wedge\tau} =  X_t\mathsf 1_{t\leqslant\tau} + X_\tau\mathsf1_{t>\tau} $$
and $t\wedge\tau$ is $\mathcal F_\tau$-measurable, so $X_\tau$ is $\mathcal B([0,\infty)\otimes\mathcal F_t$-measurable and therefore $X_\tau$ is progressively measurable (and hence adapted).
A: Refer to Math1000's answer for the definition of $\mathscr{F}_T$, when $T$ is a stopping time. The following theorem answers your first question.

Theorem (Protter).   Let $T$ be a finite stopping time. Then $\mathscr{F}_T$ is the $\sigma$-algebra generated by random variables of the form $X_T$ where $X$ is an adapted cadlag process.

The theorem says that $\mathscr{F}_T$ is generated by sampling cadlag processes at the stopping time $T$. In particular, if $X$ is adapted and cadlag, then $X_T$ is $\mathscr{F}_T$-measurable.
Proof of theorem. If $A \in \mathscr{F}_T$ then $X_t := 1_A 1_{t \geq T}$ is an adapted cadlag process with $X_T = 1_A$, showing $\mathscr{F}_T \subseteq \sigma\{X_T:X \text{ adapted cadlag}\}$. Next let $X$ adapted cadlag be given. Fix a borel $B$ and $t \geq 0$.
We need to show $\{X_T \in B\} \cap \{T \leq t\} \in \mathscr{F}_t$. We can view $X_T$ as a composition $X\circ \phi$ where $\phi(\omega) := (T(\omega),\omega)$. Since $X$ is adapted and cadlag, $X$ is progressively measurable, so that $X|_{[0,t]\times\Omega}$ is $(\mathscr{B}([0,t])\otimes \mathscr{F}_t)/\mathscr{B}(\mathbb{R})$ measurable.
 Since $\{T \leq t\} \in \mathscr{F}_t$ we have $\phi|_{\{T \leq t\}}$ is $(\mathscr{F}_t \cap \{T \leq t\})/(\mathscr{B}([0,t])\otimes \mathscr{F}_t)$ measurable (check each component separately). Thus $X|_{[0,t]\times \Omega} \circ \phi|_{\{T \leq t\}}$ is $(\mathscr{F}_t \cap \{T \leq t\})/\mathscr{B}(\mathbb{R})$ measurable. Thus $\{X_T \in B\} \cap \{T \leq t\} = \{X|_{[0,t]\times \Omega} \circ \phi|_{\{T \leq t\}}  \in B\} \in \mathscr{F}_t \cap \{T \leq t\} \subseteq \mathscr{F}_t$. Completing the reverse inclusion.
As for your second question, there is no guarantee that $X_T$ will be a random variable unless some assumptions are made. The weakest assumption one usually encounters is that $X$ is measurable, i.e. $(\mathscr{B}([0,\infty)) \otimes\mathscr{F}) / \mathscr{B}(\mathbb{R})$ measurable and $T\geq 0$ is a random time, i.e. $\mathscr{F}/\mathscr{B}([0,\infty))$ measurable.
