Suppose I have a functional L. For example $L = y+3y'$. Where y is itself a function of real variable x
It's easy for me to evaluate the Functional Derivative of L via the Euler Lagrange Equations:
$$ \frac{\partial L}{\partial y} - \frac{d}{dx} \frac{\partial L}{\partial y'}$$
But how does one do the inverse? Given a functional L, find the functional G that when applied by the above gives L.
The d/dx term makes thing very hard as the two partial derivatives are independent of each other but this differentiation forces a relationship between the two.
What you are looking for is called the inverse Helmotz problem I think : given a differential operator of second order, at what condition is there a corresponding lagrangian ?
You can learn more about this on the web (for example https://en.wikipedia.org/wiki/Inverse_problem_for_Lagrangian_mechanics) but I never found out that much references about it.
For what I know, there exists a sine qua none condition on the operator for being an Euler-Lagrange derivative of some Lagrangian, called the Helmoltz condition.
But I think that in practice, it's not always easy to use. However, if we are considering a problem with only one degree of liberty, which seems to be the case in your question, there is a more explicit condition that is equivalent, sometimes called the explicit Helmoltz condition. I think that in this case, there is even an explicit construction of the Lagrangian.
I'll see if I can find out where I've read that.
Update : I found it, it is http://www.unilim.fr/pages_perso/loic.bourdin/Documents/bourdin-thesis2013.pdf. It is half in french, half in english but the part you're looking for is in english. It is the section IV.2. page 65.