Inequality of function on interval [a,b]. I want to show, that for every $f\in C([a,b])$ inequality

$\sup|f(x)| \le (b-a)(|f(a)| + \sup|f'(x)|$ holds. 

When $b-a \ge 1$ this inequality is a simple consequence of Mean value theorem and triangle inequality. 

If $0 &lt; b-a &lt; 1$ I can construct function $g\colon [0,1]\to\mathbb{R}$ like this:

$g(t) = f\left((1-t)a + tb\right)$, and the inequality holds for $g$. 

Now, because $g(t) = f(a + (1-t)(b-a))$ it also holds for $f$.

Is that correct?
Let $x\in [a,b]$ we have $$\frac{f(x) -f(a)}{x-a} =f'(t) $$ for some $t\in [a,b].$
Thus $$|f(x)- f(a) |\leqslant |f'(t) (x-a)| \leqslant (b-a) |f'(t)| \leqslant (b-a)\sup_{t\in [a,b]} |f'(t)|$$ hence $$|f(x) |\leqslant |f(x)-f(a)| +|f(a)|\leqslant |f(a)| + (b-a)\sup_{t\in [a,b]} |f'(t)|$$ so 

$$\sup_{x\in [a,b]}|f(x) |\leqslant |f(a)| + (b-a)\sup_{t\in [a,b]} |f'(t)|.$$
Let $x\in [a,b]$ we have $$\frac{f(x) -f(a)}{x-a} =f'(t) $$ for some $t\in [a,b].$
Thus $$|f(x)- f(a) |\leqslant |f'(t) (x-a)| \leqslant (b-a) |f'(t)| \leqslant (b-a)\sup_{t\in [a,b]} |f'(t)|$$ hence $$|f(x) |\leqslant |f(x)-f(a)| +|f(a)|\leqslant |f(a)| + (b-a)\sup_{t\in [a,b]} |f'(t)|$$ so 

$$\sup_{x\in [a,b]}|f(x) |\leqslant |f(a)| + (b-a)\sup_{t\in [a,b]} |f'(t)|.$$