My question is:
If $\lbrace e_n \rbrace$ is an orthnormal basis of $L^2([0,1])$, is $\lbrace {e_n}_{|(0,1)} \rbrace$ an orthonormal basis of $L^2((0,1))$?
As the points $\lbrace 1 \rbrace$ and $\lbrace 0 \rbrace$ are sets of (Lebesgue-)measure zero the scalar products on $L^2([0,1])$ and $L^2((0,1))$ take the same values for functions that agree on $(0,1)$, right? So the orthnormality should not be the problem.
If $\lbrace e_n \rbrace_{n \in \mathbb{N}}$ is a basis of $L^2([0,1])$ then for any $x \in L^2([0,1])$ it holds that $x = \sum_{n \in \mathbb{N}} \langle x, e_n \rangle e_n$.
Also any $y \in L^2((0,1))$ can be seen as the restriction to $(0,1)$ of a $x \in L^2([0,1])$, right?
Without formal proof I guess that $y = \sum_{n \in \mathbb{N}} = \langle y,{e_n}_{|(0,1)} \rangle {e_n}_{|(0,1)}$. Is that correct? This would show my assumption.