Let $f:[0,1]\rightarrow \mathbb{R}$ be a continuously differentiable function that reaches a global maximum at $x^*\in(0,1)$. Now, consider its 'discrete' counterpart. That is, consider the collection $\{(x_1,f(x_1)),(x_2,f(x_2)),\ldots,(x_n,f(x_n)\}$ where $x_1<x_2<\cdots <x_n$, and $h=x_{n+1}-x_{n}$ 'small'.
Under what conditions on $h$ (or something else) can I claim that the maximum found using the continuous function $f$ approximates reasonably well the value $f(\hat{x})$ satisfying $f(\hat{x})\geq f(x_i)$ for all $x_i\in \{x_1,x_2,\ldots,x_n\}$?
Thanks for your help!