Can we find the maximum value of a sequence by considering a differentiable function which has the same values as the sequence on integers. Is it true that if the maximum occurs at some value $a_m$ for some integer $m$, then the differentiable function would be would have an extremum in the interval $[m-1,m+1]$?
Formally, let $f:\mathbb{R} \to \mathbb{R}$ be an everywhere diffrentiable function, then if $\exists\ n \in \mathbb{Z} $ such that $ f(n)> g(m)\ \forall \ m \in \mathbb{Z}-\left\{n\right\}$, then $\exists\ c \in \mathbb{R}$ such that $f'(c)=0$ and $|c-n| \le1$
I tried to create a counter example by plotting different curves on the plane but I couldn't find one nor could I prove it. Is the above statement true/false?