I understand Karamata's proof of Hardy Littlewood Tauberian theorem here, but what on earth is the motivation behind Lemma 4 - i.e. what would be the motivation to look at the space of all functions $g(x)$ for which $\displaystyle \lim_{x \rightarrow 1^-} (1-x)\sum_{0 \leq i} a_i x^i g(x^i) = \int_{0}^{1} g(x) dx$ ?
Trying to prove the theorem by myself first then failing and seeing the proof, I find that to be coming out of nowhere and miraculously solving the problem.