There is a proof of Gram–Schmidt orthogonalization in Kolmogorov's book. Can you explain $h_n$ and how do we write $f_n=b_n\varphi_1+\cdots+b_{n,n-1}\varphi_{n-1}+h_n$?
My main question is why does $(h_n,h_n)=0$ contradict the linear independence of the set (6)?


If $h_n=0$, then take the equation $$f_n = b_{n1} \varphi_1 + \cdots + \cdots b_{n,n-1} \varphi_{n-1}+0$$ and write each $\varphi_i$ in terms of $f_1, \ldots, f_{n-1}$ (guaranteed by condition (2)). Then you have an expression $$f_n=c_1 f_1 + \cdots + c_{n-1} f_{n-1},$$ which implies that $\{f_1, \ldots, f_n\}$ is a linearly dependent set.