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?
Assume that $n\in\Bbb Z$ and $f(n)>f(m)$ for every $m\in\Bbb Z\setminus\{n\}$.
Now consider the restriction $$g(x)=f(x)\text{ for }x\in[n-1,n+1]$$
Then $g$ has a maximum (Weierstrass' theorem) and it is not $g(n-1)$ or $g(n+1)$, since $g(n)$ is greater than both. At this maximum, the derivative of $g$ and $f$ is zero.
Remark: this proves something slightly stronger. You can say (with your notation) that $|c-n|<1$.