Verifying stopping times... Let $m$ be a natural number, $$g_m:=\sup\left\{ {n\leq m: S_n\leq 0}\right\}$$ and $$d_m:=\inf\left\{ {n\geq m: S_n \leq 0}\right\}$$ I have to check if they are are stopping times.
It's still a new topic for me, so let me use an "empirical" approach before generalizing (my primary goal is understanding).
On the first one, I fixed (it's just an example) $m=6$, for $g_6$ it may very well happen that there's no $n \leq 6$ for which $S_n \leq 0$ (hence $\left\{{g_m=n}\right\}$ may be empty), besides at time $n$, we would need informations about the future outcomes ($\leq m$) to know the realization of $g$. That is (for instance
$$\left\{ {g_6=3}\right\}=\left\{ {S_0>0,S_1>0,S_2>0, \textbf{S_3<0}, S_4>0, S_5>0, S_6>0}\right\}$$
$g_6=3$ requires $\mathcal{F_6}$.
For $d_m$, we don't need informations about the future, hence I would conclude:$$\left\{ {d_m=n}\right\}=\left\{ {S_m>0,S_{m+1}>0,...S_{n-1}>0, S_n\leq 0}\right\} \in \mathcal{F_n}$$
Am I thinking well? Anyone who could help me in writing a more (this is just intuition...) rigorous proof?
 A: Your reasoning is in both cases correct. You actually already proved that $d_m$ is a stopping time:
$$\{d_m = n\} = \bigcap_{j=m}^{n-1} \{S_j>0\} \cap \{S_n \leq 0\} \in \mathcal{F}_n$$
as $\{S_j>0\} \in \mathcal{F}_n$ for all $j=m,\ldots,n-1$ (since $S_j$ is $\mathcal{F}_j$-measurable, hence $\mathcal{F}_n$-measurable) and $\{S_n \leq 0\} \in \mathcal{F}_n$.

In order to prove that $g_m$ is not a stopping time let's consider a simple example. Let $X$ be a random variable such that $\mathbb{P}(X=1) = \mathbb{P}(X=-1) = \frac{1}{2}$ and set
$$S_1 =S_2 = 0 \quad S_3 = -1 \quad S_4=S_5 = 1 \quad S_6 = X.$$
The corresponding canonical filtration is given by
$$\mathcal{F}_0 = \ldots= \mathcal{F}_5 = \{\emptyset,\Omega\} \quad \mathcal{F}_6 = \sigma(X).$$
In particular, we see that
$$\{g_6 = 3\} = \{X=1\} \notin \mathcal{F}_3.$$
Indeed, since $\mathcal{F}_3 = \{\emptyset,\Omega\}$, $\{g_6=3\} \in \mathcal{F}_3$ would imply $$\mathbb{P}(g_6 = 3) = \mathbb{P}(X=1) \in \{0,1\}$$ and this contradicts our assumption.
