Let $F=\{f \in \mathcal C([0,1],\mathbb R) \mid f(0)=0\}$. Prove that $F^\perp = \{0\}$ Good morning, I'm trying to solve this exercise about orthogonal complement:



Because I have not learned Weierstrass's theorem yet. I tried to give an elementary proof here. It would be great if someone helps me verify it. Thank you so much!

My attempt:
Let $\varphi \in F^\perp$.


*

*If $\varphi (0)=0$ then $\varphi \in F$ and thus $\langle \varphi,\varphi \rangle = 0$. As such, $\varphi = 0$.

*If $\varphi (0) \neq 0$, WLOG we assume that $\varphi (0) > 0$.  It follows that $A=\{x \in [0,1] \mid \varphi (x) =0\} \neq \emptyset$. If not, $\varphi (x) >0$ for all $x \in [0,1]$ and thus $\langle x,\varphi \rangle= \int_0^1 x \varphi (x) >0$, which contradicts the fact that $(f(x) =x) \in F$ and $\varphi \in F^\perp$.
As such, let $a = \inf A$. Then $\varphi (x) > 0$ for all $x \in (0,a)$. We define the mapping $g:[0,1] \to \mathbb R$ by $g(x) = -x^2 +ax$ if $x \in [0,a]$ and $g(x) =0$ otherwise. It's easy to verify that


*

*$a \neq 0$ and thus $a>0$.

*$g \in \mathcal C([0,1],\mathbb R)$.

*$g(0)=g(a)=0$ and thus $g \in F$. 

*$g(x) \ge 0$ for all $x \in [0,a]$.

*$g(x) = 0$ for all $x \in [a,1]$.

*There are $0< a_1<a_2 <a$ such that $f(x) = -x^2 +ax >0$ for all $x \in [a_1,a_2]$
As such, $$\begin{aligned} \langle g,\varphi \rangle &= \int_0^1 g(x) \varphi (x) \, \mathrm{d}x \\ &= \int_0^a g(x) \varphi (x) \, \mathrm{d}x + \int_a^1 g(x) \varphi (x) \, \mathrm{d}x  \\ &= \int_0^a g(x) \varphi (x) \, \mathrm{d}x + \int_a^1 0 \varphi (x) \, \mathrm{d}x \\&=  \int_0^a g(x) \varphi (x) \, \mathrm{d}x \\ & \ge  \int_{a_1}^{a_2}  g(x) \varphi (x) \, \mathrm{d}x >0 \quad \text{because} \, g(x),\varphi(x) >0 \, \forall x\in [a_1,a_2]  \end{aligned}$$
This contradicts the fact that $g \in F$ and $\varphi \in F^\perp$. Hence $\varphi (0)=0$ and thus $\varphi = 0$.

It looks correct, but, given $f\in\mathcal C\bigl([0,1],\mathbb R\bigr)$, I would just take, for every $n\in\mathbb N$,$$f_n(x)=\begin{cases}nxf\left(\frac1n\right)&\text{ if }x\leqslant\frac1n\\f(x)&\text{ otherwise.}\end{cases}$$Then $f_n\in f$ and therefore $\langle f_n,f\rangle=0$. But then$$\lVert f\rVert^2=\langle f,f\rangle=\lim_{n\to\infty}\langle f_n,f\rangle=0.$$
