We may express \(\mathbf{x}\) as a linear combination of the basis elements:
\begin{equation*}
\mathbf{x} =
c_1 \mathbf{f}_1 +
c_2 \mathbf{f}_2 +
\cdots +
c_m \mathbf{f}_m.
\end{equation*}
We claim that \(c_i = \frac{\mathbf{x}\cdot \mathbf{f}_i}{\norm{\mathbf{f}_i}^2}\) for \(i=1,\ldots,m\text{.}\) To see this, we take the dot product of each side with the vector \(\mathbf{f}_i\) and obtain the following.
\begin{equation*}
\mathbf{x} \cdot \mathbf{f}_i = \left(c_1\mathbf{f}_1 +
c_2\mathbf{f}_2 +
\cdots +
c_m\mathbf{f}_m\right) \cdot \mathbf{f}_i
\end{equation*}
Our basis is orthogonal, so \(\mathbf{f}_j \cdot \mathbf{f}_i = 0\) for all \(j \neq i\text{,}\) which means after we distribute the dot product, only one term will remain on the right-hand side. We have
\begin{equation*}
\mathbf{x} \cdot \mathbf{f}_i = c_i\mathbf{f}_i \cdot \mathbf{f}_i.
\end{equation*}
We now divide both sides by \(\mathbf{f}_i \cdot \mathbf{f}_i = \norm{\mathbf{f}_i}^2\text{,}\) and since our claim holds for \(i=1,\ldots,m\text{,}\) the proof is complete.