Is it true that the whole space is the direct sum of a subspace and its orthogonal space?

Counter-example

$K=\Bbb R$ and $V=\mathcal C([0,1]),\Bbb R)$. If $f,g\in E$, we put $\langle f,g\rangle=\int_0^1 f(t)g(t)dt$ and let $V=\{f \in W: f(0)=0\}$. We have $V^\bot=\{0\}$

Proof: Suppose $f \in V^\bot$. Let $g\in E$ such that $g:t\mapsto t f(t)$. Then $g \in V$. By definition of $f \in V^\bot$ we have $\langle f,g\rangle=0$ which gives $\int_0^1 tf^2(t)dt=0$

Since $tf^2(t)$ is continuous and positive we have $\forall t \in [0,1]\quad tf^2(t)=0$ then $f=0$ on $]0,1]$ and on $[0,1]$ by continuity at point $0$.


Let $V = C[a,b]$ be the vector space of continuous functions on $[a,b]$ with inner product $\displaystyle \langle f,g \rangle = \int_a^b f(x)g(x)dx$.

Let $W =\{f \in V; f(a)=0\}$. Then $W^{\perp} = \{0\}$. To see why: if $h\in W^{\perp}$ then $\langle x-a,h(x) \rangle=0$ we must also have, for example, $\langle(x-a)g(x),h(x)\rangle=0$ for all $g\in V$. So $h\equiv 0$.

So $V\neq W \oplus W^{\perp}$.

edit: Mohamed beat me to it