Let $\lbrace X_{n}\rbrace$ be a stochastic process adapted to filtration $\lbrace \mathcal{F}_{n}\rbrace$. Let $B\subset \mathbb{R}$ be closed. Then $$\tau(\omega):=\mathtt{inf}\lbrace n\in\mathbb{N}:X_{n}(\omega)\in B\rbrace $$ is a stopping time.
My solution. Fix $k\in\mathbb{N}$. Then $$\lbrace\tau=k\rbrace=\lbrace\omega:X_{k}(\omega)\in B, X_{n}(\omega)\notin B,n<k\rbrace=\lbrace \omega:X_{k}(\omega)\in B\rbrace\cap\bigcap_{n=0}^{k}\lbrace\omega:X_{n}(\omega)\notin B\rbrace$$ Now, $X_{k}$ is $\mathcal{F}_{k}$-measurable, $B$ is a Borel set, so $X_{k}^{-1}(B)\in \mathcal{F}_{k}$. Since $B$ closed, the complement of $B$ is open, so also Borel, and for $n<k$ we have, by the same logic, $X_{n}^{-1}(B^{c})\in\mathcal{F}_{n}\subset \mathcal{F}_{k}$. The intersection of finitely many elements of $\mathcal{F}_{k}$ lies in $\mathcal{F}_{k}$, so for any natural $k$ it's true that $\lbrace\tau=k\rbrace\in\mathcal{F}_{k}$. Now, is this solution correct? Is it necessary to assume the closedeness of $B$? I have a feeling it's sufficient to assume that $B$ be Borel, isn't it?