Is the set of constant function in distance space ($L^2$ distance) a closed set? Q.

$C(I)=\{f:I\rightarrow\mathbb{R}|f \mbox{ : conti.}\}(I=[0,1])$

the distance is defined as follows ;

$d:C(I)×C(I)\ni(f,g)\mapsto d(f,g)=\bigg(\displaystyle\int_0^1(f(x)-g(x))^2dx\bigg)^{\frac{1}{2}}\in\mathbb{R}$

Consider the distance space $(C(I),d)$.

Show that $F$ is a closed set if $F$ is a set consisting of the entire set of constant functions belonging to $C(I)$.


I considered the following ;

$F$ is closed set $\iff$ $F^c $ is open set

i take $^{\forall}g\in F^c$.

$F^c$ is open set$\iff ^{\exists}\epsilon>0 \mbox{ s.t. }U(g;\epsilon)\subset F^c$

i take $^{\forall}f\in U(g;\epsilon)$.

for any $f$,$\bigg(\displaystyle\int_0^1(f(x)-g(x))^2dx\bigg)^{\frac{1}{2}}<\epsilon$.


But from here ,i'm not sure how to show that $f$ is a constant function. What should I do?

Thank you for your help.
 A: Maybe it's a bit more fruitful to prove $F$ is closed by taking an arbitrary converging sequence in $F$, $(f_n)$, and showing that $\lim f_n \in F$. (Look at your sequence $f_n$, they correspond to a sequence of real numbers (their constant values) ... what would be a good guess for a limit function?)
A: Take $f\in \overline{F}.$ Without loss of generality, $f\ge 0.$ If $f$ is not constant then, toward a contradiction,
Hints:
$1).\ $ There is a sequence of constant functions $c_n$ such that $c_n\overset{L^2}\to f.$
$2).\ $ There are $x<y\in I,$ such that (without loss of generality), $\inf\{f(z):z\in I\}=f(x)<f(y)=\sup\{f(z):z\in I\}.$ Set $r=f(y)-f(x).$
$3).\ $ There is a $\delta>0$ and (disjoint) open sets $U_x,U_y$ of diameter $\delta$, containing $x,y,$ resp. such that
$f(x)-\frac{r}{4}<\sup\{f(z):z\in U_x\}<f(x)+\frac{r}{4}$
$f(y)-\frac{r}{4}<\inf\{f(z):z\in U_y\}<f(y)+\frac{r}{4}.$
$4).\ $ It follows that $\displaystyle\int_0^1|c_n-f(t)|^2dt\ge \int_{U_x}|c_n-f(t)|^2dt+\int_{U_y}|c_n-f(t)|^2dt\ge \frac{\delta r^2}{16}.$
