[proofplan]
This is the ergodic specialization of the Birkhoff pointwise ergodic theorem. Birkhoff gives almost-everywhere convergence to an invariant integrable function. Ergodicity forces that invariant function to be constant, and the probability normalization identifies the constant as the integral of $f$.
[/proofplan]
[step:Apply Birkhoff's pointwise ergodic theorem]
By the [Birkhoff Ergodic Theorem](/theorems/518), the averages
\begin{align*}
A_Nf(x):=\frac1N\sum_{n=0}^{N-1}f(T^n x)
\end{align*}
converge for $\mu$-almost every $x$ to an invariant function $\bar f\in L^1(X,\mu)$ satisfying
\begin{align*}
\bar f\circ T=\bar f
\end{align*}
$\mu$-almost everywhere.
[/step]
[step:Use ergodicity to identify the limit]
Since $T$ is ergodic, every invariant integrable function is constant almost everywhere. Hence there is a constant $c\in\mathbb{R}$ such that
\begin{align*}
\bar f=c
\end{align*}
$\mu$-almost everywhere.
The same theorem identifies the constant in the finite-measure ergodic case as the spatial average. Since $\mu(X)=1$,
\begin{align*}
c=\int_X f\,d\mu.
\end{align*}
Therefore
\begin{align*}
A_Nf(x)\to\int_X f\,d\mu
\end{align*}
for $\mu$-almost every $x$.
[/step]