Orthonormal basis. Linear Algebra. Hint. 
Let $\lbrace u_{1}, ..., u_{n} \rbrace$ an orthonormal basis of $\mathbb{R}^{n}$, then $\displaystyle x = \sum_{i=1}^{n}\langle x, u_{i} \rangle u_{i}$ for all $x \in \mathbb{R}^{n}$.

I know that $\langle u_{i}, u_{i} \rangle = 1$ and $\langle u_{i}, u_{j} \rangle = 0$ if $i \neq j$, but I don't know how to use this information in this question. I didn't want the solution, just a hint.

If $$x=\sum_{j=1}^na_ju_j$$
than, by linearity of the inner product, we have:
$$
\langle x,u_i\rangle=\langle \sum_{j=1}^na_ju_j, u_i\rangle= \sum_{j=1}^na_j\langle u_j,u_i\rangle=\sum_{j=1}^na_j \delta_{i,j} = a_i
$$
