Let $V$ be a finite dimensional $\mathbb{R}$-vector space ($\dim_\mathbb{R} V=n$) and $\varphi:V\times V\to\mathbb{R}$ a symmetric nondegenerate bilinear form. Then there exist subspaces $V^+$ and $V^-$ of $V$ such that $V=V^+\oplus V^+$, $\varphi_{|V^+\times V^+}$ is positive definite, $\varphi_{|V^-\times V^-}$ is negative definite and $\varphi_{|V^+\times V^-}=0$.
Let $\dim_\mathbb{R} V^+=n_+, \;\dim_\mathbb{R} V^-=n_{-}$, the dimensions depend only on $\varphi$.
I have some questions about the proof.
Proof: Let $B$ be a basis of $V$ and $f:V\to V,\; f(b)=\sum\limits_{b'\in B}\varphi(b,b')b'$. The Gram matrix $(\varphi(b,b'))_{b,b'\in B}$ of $\varphi$ is symmetric and invertible, because $\varphi$ is symmetric and nondegenerate. It follows that there is a basis of $V$ of eigenvectors of $f$, all eigenvalues of $f$ are in $\mathbb{R}$ and nonzero. Let $V^+$ be the subspace of $V$ with basis containing all eigenvectors corresponding to positive eigenvalues and let $V^-$ be the subspace of $V$ with basis containing all eigenvectors corresponding to negative eigenvalues. It follows that $V=V^+\oplus V^+$.
Let $v, w$ eigenvectors with eigenvalues $\mu, \mu'$. On the one hand we have
$$\varphi(v,w)=\varphi(\mu ^{-1}\sum_b\varphi(v,b)b,w)=\mu ^{-1}\sum_b\varphi(v,b)\varphi(b,w)$$on the other hand it is $$\varphi(v,w)=\varphi(v,\mu' ^{-1}\sum_b)\varphi(w,b))b=\mu'^{-1}\sum_b\varphi(v,b)\varphi(b,w).$$ It follows $\mu=\mu'$ or $\varphi(v,w)=0$, hence it follows $\varphi_{|V^+\times V^+}$ is positive definite, $\varphi_{|V^-\times V^-}$ is negative definite and $\varphi_{|V^+\times V^-}=0$ (1).
Uniqueness of the dimensions: Consider $V=W^+\oplus W^-$ with $W^+$, $W^-$ as above. It is $V^-\cap W^+=0$ (2), hence $\dim V^- +dim W^+ \le n$ and similar we have $\dim V^+ +dim W^- \le n$. Otherwise it is $\dim V^+ \dim V^-=\dim W^+ + \dim W^-=n$ and therefore $\dim V^+=\dim W^+$ and $\dim V^-=\dim W^-$ (3).
I marked the steps where I have questions with numbers:
(1)The passage "It follows $\mu=\mu'$ or $\varphi(v,w)=0$, hence it follows $\varphi_{|V^+\times V^+}$ is positive definite, $\varphi_{|V^-\times V^-}$ is negative definite and $\varphi_{|V^+\times V^-}=0$ " is not clear to me, how to conclude from $\mu=\mu'$ or $\varphi(v,w)=0$ to the definiteness of $\varphi$. Could you explain me?
(2) I'm not sure how to justify that $V^-\cap W^+ =0$. Supoose that there is a nonzero vector $u\in V^-\cap W^+$. I.e. $u=\sum_{v_-}r_{v_-}v_{-}+\sum_{w_+}r_{w_+}w_{+}$ and $u\neq 0$. I don't see why this should be a contradiction.
(3)I don't understand how to conclude $\dim V^+=\dim W^+$ and so on, could you explain me the step?
I appreciate your help.
$$ \varphi(v,v) = \frac{1}{\mu} \sum_{b} \varphi(v, b)^2 > 0. $$
$$ 2n = (\dim V^{-} + \dim W^{+}) + (\dim V^{+} + \dim W^{-}) \leq 2n. $$
This forces $\dim V^{-} + \dim W^{+} = \dim V^{+} + \dim W^{-} = n$. From here, you deduce that $\dim W^{+} = n - \dim V^{-} = \dim V^{+}$ and similarly for $\dim W^{-}$.