Application Birkhoff ergodic theorem Let $(X,\mathcal{B},m,T)$ be a probability preserving transformation.
Let
\begin{align*}
I:&=\{f\in L^1: f=f\circ T\}\\
B:&=\{g-g\circ T: g\in L^1\}
\end{align*}
I have to show that
$$
\lim_{n\to \infty}\frac{1}{n}\sum_{i=0}^{n-1}f\circ T^i=\begin{cases}f\quad\mbox{if}\quad f\in I\\
0\quad\mbox{if}\quad f\in\overline{B}
\end{cases}
$$
My idea is to use \emph{Birkhoff ergodic theorem}, hence I have to prove that:
if $f\in I$, then $f=\mathbb{E}(f|\mathcal{I})$ a.s.;
if $f\in \overline{B}$, then $\mathbb{E}(f|\mathcal{I})=0$ a.s..
Where
$$
\mathcal{I}:=\{A\in\mathcal{B}: A=T^{-1}A\}
$$
Can you give an idea about how to prove one of the two points?
 A: I think you're massively over thinking things and trying to sledgehammer a walnut. If $f = f \circ T$ what is $f \circ T^n$? What is $\sum_{i=0}^{n-1} f\circ T^i$? As for the other, you might need a telescope to see what to do, but it shouldn't be too hard.

Proceeding to establish the first result in more detail then.
Firstly, let $f(x) = f\circ T(x)$ for all $x \in X_{f,1}$. By hypothesis, if $f\in I$, then $m(X_f) = 1$, and furthermore, I claim that the set $X_{f,n} = \{ x\in X\ |\ f(x) = f\circ T^n(x)\} \supseteq X_{f, n-1} \cap T^{n-1} (X_{f, 1})$ and so $m(X_{f,n})= 1$ by induction.
We can conclude that $X_f = \{x\in X\ |\ f(x) = f\circ T^n(x) \text{ for all } n\in \mathbb{N}\} = \bigcap_{n\in\mathbb{N}} X_{f, n}$ is such that $m(X_f)=1$. Therefore $\sum_{i=0}^{n-1} f\circ T^i(x) = nf(x)$ for all $x\in X_f$, that is, almost everyhere.
I should say that I feel that I've presented this in a "too plodding" manner. I would normally have said $f= f\circ T$ a.e. so $f\circ T^n$ a.e. and we can conclude $\frac{1}{n}\sum_{i=0}^{n-1} f\circ T^i = f$ a.e.
For the other part, I think its clear for $f\in B$ because things telescope. You'll have to work for a bit more, but its very doable imo. Going from there to the closure is a little trickier, but not by much.

Just to clear up some errors I made in the comment for $f\in B$. Firstly, definitely apply Birkhoff, but all that gives you is that $\hat{f} = \mathbb{E}(f|\mathcal{I})$ is $T$ invariant, and $\int_A \hat{f} = \int_A f$ for all $A\in\mathcal{I}$.
The extra argument you need is to notice that $f_n = \lim_{n\to \infty}\frac{1}{n}\sum_{i=0}^{n-1}f\circ T^i = \lim_{n\to \infty} \frac{1}{n}(g - g\circ T^n)$, where the second equality is a.e. You then need to take $L^1$ norms, argue that the sequence is converging in $L^1$ (its Cauchy) and therefore make the necessary claim about the $L^1$ norm of $\hat{f}$.
This still doesn't deal with the closure of $B$, but I think you should be okay to work out what to do with that.
