Let $\mathcal{H}$ be a complex Hilbert space, let $f, g \in \mathcal{H}$ and let $(f_j)_{j \in J} \subset \mathcal{H}$, which is indexed by an index set $J \subseteq \mathbb{Z}$. Suppose $\langle f, f \rangle = \sum_{j \in J} | \langle f, f_j \rangle|^2$. Then $$ \langle f, g \rangle = \sum_{j \in J} \langle f, f_j \rangle \langle f_j, g \rangle. $$
I have seen the above result several times, and it seems to be a standard result. In general, it is mentioned that the result follows by "polarisation". However, I am not entirely sure how to apply the polarisation identity here.
Any help and/or comment is highly appreciated.
First notice that your sum converges absolutely because $$ \sum_{j}2|\langle f,f_j\rangle \langle f_j,g\rangle| \le \sum_{j}\{|\langle f,f_j\rangle|^2+|\langle g,f_j\rangle|^2\} $$ Therefore you can define $$ [f,g] = \sum_j \langle f,f_j \rangle \langle f_j,g\rangle $$ and this form has the properties of an inner product, including positivity: $$ [f,f] = \sum_j |\langle f,f_j\rangle|^2 = \|f\|^2=\langle f,f\rangle. $$ Because of this, the polarization identity gives $[f,g]=\langle f,g\rangle$ for all $f,g$, which gives you identity you wanted: $$ \langle f,g\rangle = \sum_{j}\langle f,f_j\rangle\langle f_j,g\rangle,\;\;\; f,g\in\mathcal{H}. $$