Let $f:[a,b]\to\Bbb R$ be continuous and take any $\epsilon>0$ . Construct a step function $T$ on $[a,b]$ with $|f(x)-T(x)|< \varepsilon, \,\, \forall x \in [a,b]$ .
My approach:
(1) Since $f$ is continuous and on a compact domain, we know that the Heine-Cantor theorem holds:
$\forall \varepsilon > 0\ \ \ \exists \delta > 0 \ \ \ \forall x,y \in [a,b]:|x-y|< \delta \ \ \to |f(x)-f(y)|< \varepsilon$
This tells us that for any $\forall \varepsilon >0 \ \ \ \exists \delta >0 \ \ \ \forall x,y \in [a,b]:x\in \mathcal U_{\delta}(y) \to f(x) \in \mathcal U_{\varepsilon}(f(y))$
(2) Since the domain is compact the Heine-Borel theorem holds:
Every open cover of $[a,b]$ has a finite subcover.
This means hence: $\forall \varepsilon>0:\bigcup\limits_{x\in[a,b]} \mathcal U_{\delta_{\varepsilon}}(x)$ is a open cover of the domain $[a,b]$ there exists a $m \in \Bbb N$ so that:
$\bigcup\limits_{\mu=1}^m \mathcal U_{\delta_{\varepsilon}}(x_\mu)$ is a cover of the whole domain $[a,b]$
Now we define our step function $T_{\varepsilon}$ for any $\varepsilon>0$:
$T_{\varepsilon}:[a,b] \to \Bbb R:x \mapsto T_{\varepsilon}(x):=\begin{cases} f(x_1), & \text{for }x\in \mathcal U_{\delta_{\varepsilon}}(x_1)\,\cap [a,b] \\ f(x_2), & \text{für }x\in \mathcal U_{\delta_{\varepsilon}}(x_2)\,\cap [a,b]\setminus \bigcup\limits_{\mu=1}^1 \mathcal U_{\delta_{\varepsilon}}(x_{\mu})\\ \ \ \ \ \ \ \ \ \ \ \vdots\\ f(x_m), & \text{for }x\in \mathcal U_{\delta_{\varepsilon}}(x_m)\ \cap [a,b]\setminus \bigcup\limits_{\mu=1}^{m-1} \mathcal U_{\delta_{\varepsilon}}(x_\mu) \end{cases}$
Now for any $\varepsilon >0 $ we know because of (1) that $|f(x)-T_{\varepsilon}(x)|< \epsilon$,
since $\forall x \in \mathcal U_\delta(x_m) \ \ \to f(x) \in \mathcal U_{\varepsilon}(f(x_m))$
It would be great if someone could check if this works :)