Let $h_1,h_2:[0,1]\rightarrow \mathbb{R}$ be continuous functions.
How can we show that $h_1(x)\leq h_2(x)$ for each $x\in [0,1]$, given that $h_1(x) \leq h_2(x)$ for each $x\in \mathbb{Q}\cap [0,1]$ ?
Do we use the density of irrationals?
Let $h_1,h_2:[0,1]\rightarrow \mathbb{R}$ be continuous functions.
How can we show that $h_1(x)\leq h_2(x)$ for each $x\in [0,1]$, given that $h_1(x) \leq h_2(x)$ for each $x\in \mathbb{Q}\cap [0,1]$ ?
Do we use the density of irrationals?
On
A simple $\varepsilon$-$\delta$ proof:
By continuity of $h_1$, for any $\varepsilon>0$, there exists $\delta_1>0$ such that for any $x'\in (x-\delta_1,x+\delta_1)$, $\;\lvert h_1(x)-h_1(x')\rvert <\varepsilon$.
Similarly, there exists $\delta_2>0$ such that $\;\lvert h_2(x)-h_2(x')\rvert <\varepsilon\;$ for any $x'\in (x-\delta_1, x+\delta_2)$. Hence if $ \delta=\min(\delta_1,\delta_2)$ and $ x'\in (x-\delta, x+\delta)$, we'll have both $$\lvert h_1(x)-h_1(x')\rvert\enspace\text{and}\enspace\lvert h_2(x)-h_2(x')\rvert <\varepsilon.$$ Now suppose $h_1(x)>h_2(x)$ for some real number $x$. Choose $\;\varepsilon<\dfrac{h_1(x)-h_2(x)}2\;$ and a rational $x'$. Then we'll get $$h_2(x')<h_2(x)+\delta<h_1(x)-\delta<h_1(x')$$ which contradicts the hypothesis on the values of $h_1$ and $h_2$ for the rational values of $x'$.
You use the density of the rationals. If there's a point in $x\not\in\Bbb Q$ where $h_1(x)>h_2(x)$ then by continuity there's a whole interval where that inequality holds and therefore there's a rational where it holds, and that's your contradiction.