In this paper, we study the problems of minimizing a functional depending on the Caputo fractional derivative of order \(0< \alpha \le 1\) and the Riemann- Liouville fractional integral of order \(\beta >0\) under certain constraints. A fractional analogue of the Du Bois-Reymond lemma is proved. Using this lemma for various weak local minimum problems, the Euler-Lagrange equation is derived in integral form. Some serious works in the literature claim that the standard proof of the Legendre condition in the classical case \(\alpha =1\) cannot be adapted to the fractional case \(0<\alpha <1\) with final constraints. In spite of this, we prove the Legendre conditions using the standard classical method. The obtained necessary conditions are illustrated by appropriate examples.