This is the proof that if $(f_n)$ is cauchy in measure, there exists a subsequence $(g_k)$ of $(f_n)$ such that $(g_k)$ converges a.e. (from Bartle). I just don't understand one step in this proof. I thought that he uses a geometric series, but I couldn't figure out. Could you explain how the inequality of the red line holds?
Thank you in advance.

It is as you said. For the geometric series $ c\sum_{n=0}^N 2^n $, with $c>0$, note the explicit formula immediately gives
$$ c\sum_{n=0}^N 2^n = c\frac{2^{N+1}-1}{2 - 1} \le c2^{N+1} $$
For you, we have $N=i-j-1$, $c=2^{-i+1}$, giving
$$ 2^{-i+1} + \dots + 2^{-j} \le 2^{-i+1} 2^{i-j} = 2^{-j+1}$$
Note that the above doesn't cover the case $i=j$, but in this case, the inequality $0=|g_i(x) - g_j(x)|\le \frac1{2^j}$ is trivial.