Let $f:(-\pi, \pi) \longrightarrow \mathbb{R} $ be a function such that for every $x \in (-\pi, \pi) $, $f'(x)$ exists and it's positive.
This means that given $x_o \in (-\pi, \pi)$, we have that $\lim_{x \rightarrow x_0} \frac{f(x)-f(x_0)}{x-x_0} >0$. This means that exists $r>0$ such that if $x\in(x_0-r, x_0+r)$, then $\frac{f(x)-f(x_0)}{x-x_0} >0$. If $x \in (x_0, x_0 +r)$, then $f(x)-f(x_0) >0$. So there exists $x_1$ such that $f(x_1) > f(x_0)$. Similarly, if $x \in (x_0 - r, x_0)$, then exists $x_2$ such that $f(x_0) > f(x_2)$. We have shown that $f(x_1) > f(x_0) > f(x_2)$, this is what "locally increasing at $x_0$" has been defined to me.
Now, assuming this proof is correct, does this shows/leads to showing that $f$ is increasing?
My teacher has proven that such $f$ is indeed increasing using Lagrange’s Mean Value Theorem, since for every $a, b \in (-\pi, \pi)$, $a<b$, there exists $c \in (-\pi, \pi)$ such that $f(b) - f(a) = f'(c)(b-a)$ and since the right side is positive the left one must also be positive.
This is quick and elegant, but I still have doubts about if the first proof is correct or not, since intuitively I feel like it's correct but I have a hard time going from locally monotonicity to global.