I just learned martingales (with no depth) and I am working on the following question.
Suppose $S_n$ is a a random walk on the integers and at each step, it increases by 1 with probability $p$ or decreases by 1 with probability $1-p$.
Suppose $f(S_n)$ is an increasing function from $\mathbb{Z}\to \mathbb{R}$, and $f(S_n)$ is a martingale. I want to show $S_n$ is recurrent if and only if $\sup f=\infty$ and $\inf f=-\infty$.
Assume $S_n$ recurrent, and $\sup f=\infty$ and $\inf f=-\infty$ does NOT hold. $f(S_n)$ must be bounded (at least on one side), then $f(S_n)$ converges almost surely. I kind have the intuition that since $S_n$ has to increase or decrease by 1 as $n$ grows, to make $f(S_n)$ converges almost surely, $S_n$ can not go back to the same point infinitely often (being recurrent).
But I'm confused with the notion of almost sure converges of $f(S_n)$, what does it mean for $f(S_n)$ to converge almost surely?