Let $V$ a vector space over field $\mathbb{K}$ with inner product and let $U$ and $W$ subspaces of $V$ so that $U \subseteq W^{\perp}$ and $V = W+U$. Show that $U=W^{\perp}$.
I try this approach: Let $w \in W+U$ so $w \in U$ and $\langle w,v \rangle = 0$ for all $v \in W$. In particular $\langle w,w \rangle = 0$ implies $w=0$ and direct sum $V = W \oplus U$.
My question is, can I compare $V = W\oplus U$ with decomposition $V = W\oplus W^{\perp}$ and conclude $U=W^{\perp}$?
As you are supposed to prove $U=W^{\perp}$, and you know $U\subseteq W^{\perp}$, one would expect you to try to prove $W^{\perp}\subseteq U$:
Proof: Let $v\in W^{\perp}$. Write $v=w+u$ with $w\in W, u\in U$, i.e. $w=v-u$. Let's calculate $\langle w,w\rangle$:
$$\langle w,w\rangle=\langle v-u,w\rangle=\langle v,w\rangle-\langle u,w\rangle=0-0=0$$
which implies $w=0$, i.e. $v=u\in U$.
Decomposition: As for the decomposition $V=W\oplus W^{\perp}$: it can be done in finite-dimensional vector spaces, and this can lead to a valid (dimensional) argument. If $V$ is finite-dimensional, you will know that $\dim W+\dim U=\dim (W+U)+\dim(W\cap U)\ge\dim V=\dim W+\dim W^{\perp}$, i.e. $\dim U\ge\dim W^{\perp}$ (which with $U\subseteq W^{\perp}$ gives $U=W^{\perp}$).
The same argument is not valid in infinite-dimensional vector spaces, because in general it is not possible to prove that $W+W^{\perp}=V$ at all. For an example, see e.g. Non-closed subspace of a Banach space. (Further to that, the dimensional argument, obviously, won't work.)