This is part of the proof of Urysohn lemma.
Part of it states
It it clear that $0\le f(x)\le 1$ where $f=sup_rf_r$ and $f_r(x)=\begin{cases}r\qquad \text{if}\quad x\in V_r\\ 0\qquad a.o.c\end{cases}$
Please verify what I have done below to prove $0\le f\le1$
Case 1: consider $f_r=r.$ Then $f=\sup_rf_r=\sup_rr=r$. r is rational and it is defined on $[0,1]$ (definition stated at the start of the proof) This implies $0\le f\le 1.$
Case 2: consider $f_r=0.$ Then $f=0$, clearly this cannot imply $0< f\le 1$.
then how should I proceed?
Please help
Recall that $r$ is a rational in $[0,1]$ so that $$f_r(x)=\begin{cases} r &:\ x\in V_r\\ 0 &:\ \text{otherwise}\end{cases}$$ implies $0\leq f_r(x)\leq r\leq1$ for all $x\in X$. Note the upper and lower bounds are independent of $r$. Therefore, taking the supremum over all $r\in[0,1]\cap\mathbb Q$ gives $$0\leq\sup_{r\in[0,1]\cap\mathbb Q} f_r(x)\leq 1.$$Since $f(x)=\sup_r f_r(x)$, it follows that $0\leq f(x)\leq 1$ for all $x\in X$.