If $0\leq a < b\leq 1;\ p: [a,b]\to [f(m),f(M)] \subset [0,1],$ where $p(m) = \min_{x\in(a,b)} p(x) $ and $p(M) = \max_{x\in(a,b)} p(x), $ is a non-constant continuous function, then $ h_p(x):[0,1]\to[0,1];\ h_p(x):=\frac{p((b-a)x+a)-p(m)}{p(M)-p(m)}$ is the function $p$ but translated and stretched to have domain $[0,1]$ and range $[0,1].$
Let $f: [0,1]\to [0,1]$ be a non-constant continuous function. Does there exist an interval $(a,b)$ where $0\leq a < b \leq 1$ on which $f$ is non-constant, and a continuous concave or convex function $g: (a,b)\to [0,1],$ such that
$$ \left\vert f_p(x) - g_p(x) \right\vert < \frac{1}{100} \quad \forall x\in [0,1],\ $$ where $f_p$ and $h_p$ are as defined above?
$$$$
I tried proof by contradiction but didn't get anywhere.
I also thought about using Weierstrass approximation theorem, since every polynomial has concave and convex sections. But I think this theorem is about global distance ("uniformly approximated"), not relative distance like in the inequality, so I don't think it helps.
Maybe something like the Weierstrass function is a counter-example but I don't know.
Let $0<\epsilon<\min(\frac{1}{800}(f(M)-f(m)), 1/2)$. By Weierstrass approximation theorem, there exists a polynomial $g:[0, 1]\to\mathbb{R}$ such that $|f(x)-g(x)|<\epsilon/2$, for every $x\in[0, 1]$. If $g$ is linear, it is convex everywhere, and if it is not, then it has degree at least 2, so its second derivative is not identically zero, and we may take an interval $[a, b]$ where $g$ is convex (or concave). If the range of $g$ is not in $[0, 1]$, we can restrict even more $[a, b]$ so that $g$ exceeds only one of $0$ or $1$. If it exceeds $1$, take $a, b$ such that $g>1/2$ in $[a, b]$, and thus, taking $\bar g=g-\epsilon/2$, the range of $\bar g$ in $[a, b]$ is within $[0, 1]$, $|\bar g-f|<\epsilon$ uniformly and $\bar g$ is still convex (or concave).
Under all this considerations, we can assume that $g$ defined over $[a, b]$ is convex, non-constant, its range is within $[0, 1]$ and $|g-f|<\epsilon$ uniformly.
Let $g(m')$ (resp. $g(M')$) be the min (resp. max) of $g$ in $[a, b]$. Then $$g(m')\le g(x)<f(x)+\epsilon,$$ so that $g(m')< f(m)+\epsilon$, and $$f(m)\le f(x) < g(x)+\epsilon,$$ so that $g(m')>f(m)-\epsilon$. In a similar way, we have that $|f(M)-g(M')|<\epsilon$.
Now, if $r(x)=f((b-a)x+a)$, $s(x)=g((b-a)x+a)$ and $$d(x)=f_p(x)-g_p(x),$$ as $$r(x)-f(m)-2\epsilon < s(x)-g(m') < r(x)-f(m)+2\epsilon$$ and \begin{align*} d(x)&=\frac{r(x)-f(m)}{f(M)-f(m)} - \frac{s(x)-g(m')}{g(M')-g(m')} \\\ &= \frac{n(x)}{(f(M)-f(m))(g(M')-g(m'))}, \end{align*} where $$n(x)=(g(M')-g(m'))(r(x)-f(m))-(f(M)-f(m))(s(x)-g(m')),$$ then \begin{align*} n(x)&= (g(M')-g(m'))(r(x)-f(m))-(f(M)-f(m))(s(x)-g(m'))\\\ &<(f(M)-f(m)+2\epsilon)(r(x)-f(m))-(f(M)-f(m))(r(x)-f(m)-2\epsilon)\\\ &=2\epsilon(r(x)+f(M)-2f(m)) \end{align*} and \begin{align*} n(x)&= (g(M')-g(m'))(r(x)-f(m))-(f(M)-f(m))(s(x)-g(m'))\\\ &>(f(M)-f(m)-2\epsilon)(r(x)-f(m))-(f(M)-f(m))(r(x)-f(m)+2\epsilon)\\\ &=-2\epsilon(r(x)+f(M)-2f(m)), \end{align*} so that \begin{align*} |d(x)| &< 2\epsilon\frac{r(x)+f(M)-2f(m)}{(f(M)-f(m))(g(M')-g(m'))}\\\ &\le 4\epsilon\frac{1}{f(M)-f(m)-2\epsilon} \\\ &\le \frac{4\epsilon}{f(M)-f(m)-(f(M)-f(m))/2} \\\ &<\frac{1}{100}. \end{align*}
The annoying part is ensuring that the range of $g$ is within $[0, 1]$