Solution (source code)

= Solution

The <Doob maximal inequality for a nonnegative submartingale> states that, for a nonnegative <submartingale> $(M_j)_{0\leq j\leq N}$ and $u>0$,
$$
u\,\mathbb P\!\left(\max_{0\leq j\leq N}M_j\geq u\right)\leq\mathbb EM_N.
$$
For completeness, partition the crossing event according to its first crossing time $j$. On that event $M_j\geq u$, while $\mathbb E[M_N\mid\mathcal F_j]\geq M_j$. Summing the corresponding expectations over $j$ proves $u\mathbb P(\max M_j\geq u)\leq\mathbb E[M_N\mathbf1_{\{\max M_j\geq u\}}]\leq\mathbb EM_N$.

If $q>p$, the exponential $r^{S_j}$, with $r=q/p>1$, is increasing as a function of $S_j$. Apply the inequality to the <martingale> from part (a), with $u=r^k$:
$$
\mathbb P\!\left(\max_{0\leq j\leq N}S_j\geq k\right)
\leq r^{-k}\mathbb EZ_N=(p/q)^k.
$$
Letting $N\to\infty$ and using continuity of <probability measures> on increasing events gives
$$
\boxed{\mathbb P\!\left(\sup_{n\geq0}S_n\geq k\right)\leq(p/q)^k,\qquad k\geq1.}
$$
The same event is obtained if the supremum excludes time zero, since $k\geq1$. If $p\geq q$, the right side is at least one and the bound is automatic; the nontrivial <Doob maximal inequality> argument is for $q>p$.