# Show that for any numbers $p$ and $q$, $\{f\in C[a,b]:p\leq f(x)\leq q\}$ where $x\in [a,b]$ is a closed subset of $C[a,b]$. Similarly for $L_2[a,b]$.

Show that for any numbers $p$ and $q$, $\{f \in C[a,b] \mid \forall x\in [a,b]: p\leq f(x)\leq q\}$ is a closed subset of $C[a,b]$. Similarly for $L_2[a,b]$.

We must show that if $f_n\to F$ and $f_n\leq p$, then $F\leq p$. I'm not sure how to do it. Any solutions or hints are greatly appreciated.

As you say, you have to show that $f_n \to f$ implies $p1 \leq f \leq q1$, where $1$ is the constant function on $[a,b]$ with value $1$. The claim now follows from the fact that if you have a converging sequence $a_n \in \mathbb R$ with $a_n \leq C$, then $\lim_n a_n \leq C$. Furthermore you need to show that $f$ is continuous, which follows from compactness of $[a,b]$ and the resulting uniform convergence.
Now you can see how it works for $L_2$, as well.
Fix $t \in [a,b]$. The set $\{f \in C[a,b]: f(t) \in [p,q]\}$ is the preimage of the closed set $[p,q]$ under the evaluation map $g_t(f)=f(t)$, therefore it is closed. The intersection of such closed sets over $t \in [a,b]$ is also closed.