We show that the generation problem in Thompson's group F is decidable, i.e., there is an algorithm which decides if a finite set of elements of F generates the whole F. The algorithm makes use of the Stallings 2-core of subgroups of F, which can be defined in an analogous way to the Stallings core of subgroups of a finitely generated free group. Further study of the Stallings 2-core of subgroups of F provides a solution to another algorithmic problem in F. Namely, given a finitely generated subgroup H of F, it is decidable if H acts transitively on the set of finite dyadic fractions D. Other applications of the study include the construction of new maximal subgroups of F of infinite index, among which, a maximal subgroup of infinite index which acts transitively on the set D and the construction of an elementary amenable subgroup of F which is maximal in a normal subgroup of F.