Shortly, with the details omitted, the claim of this lemma is that if for all $h$ such that $h(a)=h(b)=h'(a)=h'(b)=0$ we have $\int_a^b \alpha h'' = 0$, then $\alpha(x) = c_0 + c_1x$.
The first step in the proof is finding $c_0$ and $c_1$ as the constants that satisfy
$\int_a^b \alpha - c_0 - c_1x = 0$
and
$\int_a^b (\int_a^x (\alpha(y) -c_0 - c_1y \,) dy) dx$.
First, I can follow the rest of the proof, but I don't see why such constants must exist. Integrating the expressions above, we can express the values of these constants as the solutions of two linear equations with two variables, but I don't see why the system is linearly independent.
Second, I don't really see any intuition for how one might discover the proof for a lemma like this one. In the previous Lemma 2 which is similar but concerns the expression $\int_a^b \alpha h'$, there is the intuitive explanation that the $h$ are exactly those functions that satisfy $\int_a^b h' = 0$ and so subtracting a constant from $\alpha$, we can obtain $\int_a^b (\alpha -c)^2 =0$.
More generally, how does one figure out lemmas like this one? While I seem to somewhat understand the general theory of the topic (calculus of variations) and can follow along the book, things like this Lemma 3 just seem to come out of nowhere to me. Perhaps I'm trying to tackle something that is too advanced for me, and might need more practice with solving real analysis problems. I do feel like that I can handle certain problems quite well, but then there's certain theorems that just seem to come out of nowhere - another example I remember I never really had any intuition for was the following mean value theorem: Suppose $f,g$ are continuous, $g$ is monotone, then $\int_a^b fg = g(a)\int_a^c f + g(b) \int_c^b f$ for some $c$.
I'm sorry for the lack of rigor in this post, but I don't feel like it's what I really struggle with, so I chose to avoid it to keep the post reasonably short and easy to read. I would appreciate any input on what might be a good approach to improving my capabilities of figuring out problems like these by myself and how to find the intuition behind certain proofs like these - at the moment, I essentially don't see how one would figure this out by themselves, even after seeing the proof. In algebra, I can generally deduce from a proof why one would eventually consider a certain approach that gives the actual proof, but it feels like certain proofs in analysis are just far too short and don't really tell the whole story of how one might have approached the problem to find the given proof that works.