If $x\perp E$ then $x\perp\overline{\operatorname{span}E}.$ I have been struggling with this problem for awhile.
Let $X$ be an inner product space and $E$ a nonempty subset of $X$. If $x\perp E$, then $x\perp \overline{\operatorname{span}E}$.
Let $X$ be an inner product space and $E$ a nonempty subset of $X$ and suppose that $x\perp E$. Since $x\in E^{\perp}$ we know that $\langle x,e\rangle=0$ for every $e\in E$. This further implies that for any $k\in\mathbb{F}$ we have that $\|x-ke\|\geq \|x\|$. Recall that $$\operatorname{span}E=\left\{ \sum_{i=1}^nk_1e_1\mid n\in\mathbb{N},e_i\in E,k_1\in\mathbb{F}\right\}.$$ Let $y\in \operatorname{span}E.$ We compute
\begin{align*}
    \langle x,y\rangle&=\langle x,k_1e_1+\cdots+k_ne_n\rangle\\
    &=\langle x,k_1e_1\rangle+\cdots+\langle x_n,k_ne_n\rangle\\
    &=\bar{k}_1(0)+\cdots+\bar{k}_n(0)=0
\end{align*}
So $x\in \operatorname{span}E^\perp$.
Now recall that $\overline{\operatorname{span}E}=\{u\in X:\forall\varepsilon>0,\exists y\in\operatorname{span}E\text{ such that }\|u-y\|<\varepsilon\}.$ Let $u\in\overline{\operatorname{span}E}$.
This is the point that I have been getting stuck at. I've been reading a few different sources and basically they suggested finding the linear span first and then finding the closure of that. So a few ideas I have been playing around with are to take $\|u-y\|<\varepsilon$ and apply that to $\|x-ku\|$ and then try to show that this is greater than $\|x\|$. But it wasn't quite working the way I wanted.
The next idea I tried was that $\langle x,u\rangle=\frac{1}{4}(\|x+u\|^2-\|x-u\|^2+i\|x+iu\|^2-i\|x-iu\|^2)$ but I have been struggling to figure out what it is that I can claim about any of these parts.
I thought that using the fact that I know that $x\in\operatorname{span}E^\perp$ would help but I am at a loss.
What steps/assumptions would you recommend to me so that I can continue moving forward?
 A: You have already shown that if $x \perp E$, then $x \perp \operatorname{span}(E)$.
Next, show that the set $x^\perp$ of $y$ such $\langle y, x \rangle = 0$ is a closed set, and hence if it contains $\operatorname{span}(E)$ it must also contain $\overline{\operatorname{span}(E)}$.
That $x^\perp$ is closed follows from the fact that it is the preimage of $\{0\}$ a finite, hence compact, hence closed set under a continuous map $y \mapsto \langle y, x\rangle$.
That this map is continuous follows immediately from Cauchy–Schwarz: $|\langle y_2-y_1, x \rangle| \leq \|y_2-y_1\| \cdot\|x\|$.
A: Define $f:X \to F$ ($F= \mathbb{R}$ or $\mathbb{C}$) by
$f(y)=\langle y, x \rangle$ for all $y\in X$.
Note that $f$ is linear and $\|f\|=\|x\|$. Since $f$ is bounded, it is continuous. Note that
$x^{\perp}=\ker f.$
Now, use the sequential criterion for continuous function.
A: Let $y \in \overline{\operatorname{span}E}$. Then there is a sequence $y_n \in \operatorname{span}E$ such that $y = \lim_n y_n$. Then by continuity of the inner product,
$$\langle x,y\rangle = \lim_n \langle x,y_n\rangle  = 0$$
since you have already established that $\langle x,y_n\rangle = 0$ for all $n$.
A: Assuming that $x^\perp$ is a closed linear subspace, then $$x\perp E\iff E\subseteq x^\perp\iff [E]\subseteq x^\perp\iff \overline{[E]}\subseteq x^\perp\iff  x\perp\overline{[E]}$$ (where $[E]$ is the span of $E$).
