Theorem: If $f: V \times V \rightarrow \mathbb{R}$ is a symmetric bilinear form, then there exists a basis for $V$, for which the matrix of $f$ is diagonal and coefficients on the diagonal are $1$, $-1$ or $0$.
I already have the proof that this basis exists, however, I am lost when it comes to the coefficients. Here's a part of the proof I got written down:
If $f(v_j, v_j) \neq 0$, then let $\widetilde{v_j} = \frac{v_j}{\sqrt{\left | f(v_j, v_j) \right |)}}$.
$f(\widetilde{v_j}, \widetilde{v_j}) = f(\frac{v_j}{\sqrt{\left | f(v_j, v_j) \right |)}}, \frac{v_j}{\sqrt{\left | f(v_j, v_j) \right |)}}) =$
$=\frac{f(v_j, v_j)}{\left | f(v_j, v_j) \right |} = \pm 1$
I don't understand the last line - where did it come from? Which bilinear properties should I take advantage of?