A bit of confusion in finding invariant measures I'm currently studying Ergodic theory and I'm a bit confused about one way in which we define invariant measures. A measure $\mu(A)$ on a set $A$ is said to be invariant, if for some measurable function $f$, $\mu(A)= \mu(f^{-1}(A))$. I noticed in the lecture notes that the example using the Gauss map is as follows: 

The first line confuses me since we somehow reverted to describing $T^{-1}[a,b]$ in terms of $T[a,b]$ and I can't understand why this is justifiable. Moreover, I'm not sure why this correctly shows that the measure will ultimately be invariant. 
 A: Suppose $0 \leq a \leq b \leq 1$.  Observe that if $x \in [0,1]$, then $x \in T^{-1}([a,b])$ if and only if there is a $n \in \mathbb{Z}$ such that $n + a \leq \frac{1}{x} \leq n + b$.  Since $x \in [0,1]$, we know that $\frac{1}{x} \geq 1$.  Thus, $n \in \{1,2,\dots\}$.  In particular, we can conclude by inverting the inequality that $\frac{1}{n + b} \leq x \leq \frac{1}{n + a}$.  This proves 
\begin{equation*}
T^{-1}([a,b]) \subseteq \bigcup_{n = 1}^{\infty} \left[\frac{1}{n + b}, \frac{1}{n + a}\right]
\end{equation*}
Running the argument backwards, we see that the opposite inclusion also holds so that the two sets are, in fact, equal.  Note also that the sets in the union are disjoint, which follows from the fact that the sets $\{[n + a, n + b]\}_{n \in \mathbb{Z}}$ are disjoint.  
The disjointness of the sets $\{[(n + b)^{-1},(n + a)^{-1}]\}_{n \in \mathbb{N}}$ justifies the computations in your graphic.  Thus, it remains to prove 
\begin{equation*}
\frac{1}{\log(2)} \sum_{n = 1}^{\infty} \left[\log \left(1 + \frac{1}{a + n}\right) - \log \left(1 + \frac{1}{b + n}\right) \right] = \frac{1}{\log(2)} \left(\log(1 + b) - \log(1 + a)\right)
\end{equation*}
since the RHS equals $\mu([a,b])$.  To do this, we use the properties of the logarithm.  In particular,
\begin{align*}
\sum_{n = 1}^{N} \log \left( 1 + \frac{1}{a + n}\right) &= \log \left(\prod_{n = 1}^{N} \left(1 + \frac{1}{a + n} \right) \right) \\
  &= \log \left( \prod_{n = 1}^{N} \left(\frac{a + n + 1}{a + n} \right)\right) \\
  &= \log \left(\frac{a + N + 1}{a + 1}\right).
\end{align*}
Therefore,
\begin{align*}
\sum_{n = 1}^{N} \left[\log\left(1 + \frac{1}{a + n}\right) - \log\left(1 + \frac{1}{b + n} \right)\right] = \log\left(\frac{a + N + 1}{b + N + 1} \cdot \frac{b + 1}{a + 1} \right).
\end{align*}
Sending $N \to \infty$, we obtain
\begin{equation*}
\sum_{n = 1}^{\infty} \left[\log \left(1 + \frac{1}{a + n}\right) - \log \left(1 + \frac{1}{b + n}\right) \right] = \log(1 + b) - \log(1 + a),
\end{equation*}
which, after dividing by $\log(2)$, is what we were after.
