Showing uniform integrability 
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? 
 A: 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.
