Let $f:S\to\mathbb{R}$ be differentiable at $x_0\in S$. Let $x_0$ be a saddle point of $f$ that is there exists $\delta>0$ such that $f(x)\leq f(x_0)$ for all $x\in(x_0,x_0+\delta)$ and $f(x)\geq f(x_0)$ for all $x\in(x_0-\delta,x_0)$. So at one side $x_0$ is a point of maximum and at another side, $x_0$ is a point of minimum of $f$.
I am unable to prove the first derivative $f'(x_0)=0$. I tried in the following way: Let $x=x_0+h$ where $|h|<\delta$, then by the given condition for the right-hand side, we get $f(x_0+h)\leq f(x_0)$ for every $0<h<\delta$. Thus, $$ \lim_{h\to 0^+}\frac{f(x_0+h)-f(x_0)}{h}\leq 0. $$ Therefore, $f'(x_0)\leq 0$. On the otherhand, by the given condition with the left hand side, we get $f(x_0+h)\geq f(x_0)$ for every $-\delta<h<0$. Thus, $$ \lim_{h\to 0^-}\frac{f(x_0+h)-f(x_0)}{h}\leq 0, $$ which again gives $f'(x_0)\leq 0$. But to conclude I need to prove that $f'(x_0)\geq 0$.
Can someone please help to proceed. Thanks.