Recall the following statement:
Let $X \in L^1$ be a random variable and $\mathcal{F}$ a $\sigma$-algebra. Then $Y = \mathbb{E}(X \mid \mathcal{F})$ if and only if $Y \in L^1$ is $\mathcal{F}$-measurable and $$\forall F \in \mathcal{F}: \int_F X \, d\mathbb{P} = \int_F Y \, d\mathbb{P}. \tag{1}$$ If $\mathcal{F}$ is generated by some family $\mathcal{G}$ which is $\cap$-stable (i.e. $F,G \in \mathcal{G} \implies F \cap G \in \mathcal{G})$) and there exists some sequence $(G_j) \subseteq \mathcal{G}$ such that $G_j \uparrow \Omega$, then it suffices to check $$\forall G \in \mathcal{G}: \int_G X \, d\mathbb{P} = \int_G Y \, d\mathbb{P} \tag{2}$$ instead of $(1)$.
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.
The solutation also says somewhere that $T-1$ is not a stopping time. Why is that?
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.