Consider the Sobolev space $W^{2,2}([0,1],\mathbb{R})$. Since $p =2 $ this is also a Hilbert space.
Now consider the linear subspace $S = \{ f \in W^{2,2}([0,1],\mathbb{R}) \quad | f(0) = f(1) = 0 \}$.
$S$ is a linear subspace since addition and multiplication are well defined in $S$.
Is $S$ also closed?
We know that there is a continuous embedding $i: W^{2, 2}([0, 1], \mathbb{R}) \rightarrow C([0, 1], \mathbb{R})$. Now let $G, T: C([0, 1], \mathbb{R}) \rightarrow \mathbb{R}$ be the mappings $$ G(f) := f(0), ~T(f) := f(1). $$ $G$ is continuous because for all $f \in C([0, 1], \mathbb{R})$ we have $$ \lvert G(f) \rvert = \lvert f(0) \rvert \leq \sup_{x \in [0, 1]} \lvert f(x) \rvert = \lVert f \rVert_{C([0, 1], \mathbb{R})}. $$ The same argument proves that $T$ is continuous. Therefore we can write $$ S = (T \circ i)^{-1}(\lbrace 0 \rbrace) \cap (G \circ i)^{-1}(\lbrace 0 \rbrace). $$ Both $(T \circ i)^{-1}(\lbrace 0 \rbrace)$ and $(G \circ i)^{-1}(\lbrace 0 \rbrace)$ are closed, because $T$, $G$ and $i$ are continuous. Therefore $S$ is closed.