Let $f:\mathbb{N}\to \mathbb{R}$ measurable and $T$ be a $\mathbb{N}$-valued random variable such that $f(T)\in L^1(\mathbb{P})$. For every $n\geq 0$, define $\mathcal{F}_n:=\sigma(\{T=k\},\ k\leq n)$ and $$X_n:=1_{\{T\leq n\}}f(T)+1_{\{T\geq n\}}r(n)$$ where $$r(n):=\frac{\mathbb{E}[1_{\{T>n\}}f(T)]}{\mathbb{P}(T>n)}$$ 1. Check that $(X_n)_{n\geq 0}$ is a uniformly integrable ($\mathcal{F}_n)_{n\geq 0}$-martingale
The solution says:
We observe $X_n=\mathbb{E}[f(T)\mid \mathcal{F}_n], n\geq 0$. By the equivalence theorem $(X_n)_{n\geq 0}$ is a uniformly integrable ($\mathcal{F}_n)_{n\geq 0}$-martingale
I don't see why $X_n=\mathbb{E}[f(T)\mid \mathcal{F}_n]$ holds:
$$X_n=1_{\{T\leq n\}}f(T)+1_{\{T\geq n\}}\frac{\mathbb{E}[1_{\{T>n\}}f(T)]}{P(T>n)}=\ ? = \mathbb{E}[f(T)\mid \mathcal{F}_n]$$
Second question:
The solution also says somewhere that $T-1$ is not a stopping time. Why is that?
Recall the following statement:
In your example $\mathcal{F}_n$ is generated by $\mathcal{G}_n = \{\{T=k\}; k \leq n\} \cup \{\{T>n\}\}$. Since $$X_n = 1_{\{T \leq n\}} f(T) + 1_{\{T > n\}} r(n) = \sum_{k=1}^n f(k) 1_{\{T=k\}} + 1_{\{T>n\}} r(n)$$ is $\mathcal{F}_n$-measurable, we have to show $$\forall G \in \mathcal{G}_n: \int_G X_n \, d\mathbb{P} = \int_G f(T) \, d\mathbb{P} \tag{3}$$ in order to establish $$X_n = \mathbb{E}(f(T) \mid \mathcal{F}_n).$$ Now let $G=\{T=k\} \in \mathcal{F}_n$ for some $k \leq n$. Then
$$\int_G X_n \, d\mathbb{P} = \int_{\{T=k\}} f(k) \, d\mathbb{P} = \int_{\{T=k\}} f(T) \, d\mathbb{P} = \int_G f(T) \, d\mathbb{P}.$$
Similarly, if $G=\{T>n\} \in \mathcal{F}_n$, then
$$\int_G X_n \, d\mathbb{P} = r_n \int_{\{T>n\}} \, d\mathbb{P} \stackrel{\text{def $r(n)$}}{=} \mathbb{E}(1_{\{T>n\}} f(T)) = \int_G f(T) \, d\mathbb{P}.$$
Consequently, we have shown $(3)$, and this finishes the proof.
Well, because, in general $\{T-1 \leq n\} = \{T \leq n+1\} \notin \mathcal{F}_n$. In case you prefer a concrete (counter)example: Consider $$X_n := \begin{cases} 0, & n \in \{0,1\}, \\ Y, & n \geq 2 \end{cases}$$ for some random variable $Y$ satisfying $\mathbb{P}(Y=1) = \mathbb{P}(Y=-1) = 1/2$, and define
$$T := \inf\{n \in \mathbb{N}; X_n = 1\}.$$
It is not difficult to check that $T$ is a stopping time with respect to the canonical filtration of $(X_n)_{n \in \mathbb{N}}$. On the other hand,
$$\{T-1=1\} = \{T=2\} = \{Y=1\}$$
is not contained in $\mathcal{F}_1 = \{\emptyset,\Omega\}$; consequently $T-1$ is not a stopping time.