I'm trying to solve a functional minimization problem of the following form:

$$\arg\min_{f:\mathbb{R}\rightarrow [0,1]} h(f)$$ where $h$ is some expression in terms of several integrals over $f$.

I have a heuristic calculation that seems indeed to work (to find at least a local minimum): I simply treat $f:\mathbb{R}\rightarrow [0,1]$ as a continuum of variables $f(x)$ for each $x \in \mathbb{R}$, "take the derivative" of $h$ with respect to each variable $f(x)$, set it to zero, and solve. Together, this gives me a functional form for $f$. In my setting, this indeed seems to work, but obviously this technique is not rigorous as stated.

My question is, are there any conditions under which functional minimization can be done in this way? When can this technique be made rigorous?