Let $a, b \in \mathbb{R}, a<b$, and let $f:[a,b]\to \mathbb{R}$ be a continuous function. Given $\varepsilon>0$, show that there exists $\alpha_1, \alpha_2, \dots, \alpha_n \in \mathbb{R}$ and $m_1, \dots, m_n$ non-negative integers such that $$|f(x) - \sum_{i=1}^{n} \alpha_ie^{m_ix}| \leq \varepsilon, \forall x \in [a, b].$$
This question provided a couple of hints for a slightly different version of mine, with $m_1, \dots, m_n$ are negative integers, but I couldn't adapt them to the problem at hand or come up with any new tricks. I'm looking for a detailed solution, as I'm also on the process of learning uniform convergence and Berstein polynomials (which might be a way out of this).
This is a direct consequence of Stone-Weierstrass theorem, considering the subalgebra $$ \left\{\sum_{i=1}^n\alpha_ie^{m_ix} : \alpha_i\in\mathbb R,m_i\geq0\right\} $$ of $C([a,b])$.