I came across this theorem in Apostol's Mathematical Analysis and the proof makes sense and seems to be correct.
https://drive.google.com/file/d/1-sRgtgGlQ5N8h9Vq5eosftjcEbOavOv0/view?usp=drivesdk
However, I also encountered this counterexample in the book 'Counterexamples in Analysis' by Gelbaum and Olmstead. I think I am missing something here and these two might be different, but I am not able to say how.
https://drive.google.com/file/d/1-sNtOdB06WBH5_unbgdJSdpUEugK2IeS/view?usp=drivesdk
This is a somewhat subtle point.
The theorem in the first link is saying that there is a neighborhood of $c$ such that if $x$ is in that neighborhood then $f(x)-f(c)$ has the same sign as $x-c$. This does not mean that $f$ is increasing on a neighborhood of $c$, which would amount to saying that there exists a neighborhood of $c$ such that if $x,y$ are both in that neighborhood then $f(x)-f(y)$ has the same sign as $x-y$.
The counterexample given in the second link shows that in general being differentiable on $(a,b)$ with $f'(c)> 0$ doesn't imply that $f$ is increasing on a neighborhood of $c$.
Note that being continuously differentiable with $f'(c)>0$ does imply that $f$ is increasing on a neighborhood of $c$, but the counterexample in the second link is not continuously differentiable.
To visualize this, it can help to graph $g(x)=x+2x^2$ and $h(x)=x-2x^2$; the graph of $f$ bounces back and forth between the graph of $g$ and the graph of $h$ faster and faster as you approach $x=0$. But now think about the graphs of $g$ and $h$ themselves: both $g$ and $h$ have the same sign as $x$ as long as $|x|<1/2$. Therefore the same is true of $f$.