The relationship between the early-age activity of Mediterranean fruit flies (medflies) or other fruit flies and their lifespan has not been much studied, in contrast to the connections between lifespan and diet, sexual signaling, and reproduction. The objective of this study is to assess intra-day and day-to-day activity profiles of female Mediterranean fruit flies and their role as biomarker of longevity as well as to explore the relationships between these activity profiles, diet, and age-at-death throughout the lifespan. We use advanced statistical methods from functional data analysis (FDA). Three distinct patterns of activity variations in early-age activity profiles can be distinguished. A low-caloric diet is associated with a delayed activity peak, while a high-caloric diet is linked with an earlier activity peak. We find that age-at-death of individual medflies is connected to their activity profiles in early life. An increased risk of mortality is associated with increased activity in early age, as well as with a higher contrast between daytime and nighttime activity. Conversely, medflies are more likely to have a longer lifespan when they are fed a medium-caloric diet and when their daily activity is more evenly distributed across the early-age span and between daytime and nighttime. The before-death activity profile of medflies displays two characteristic before-death patterns, where one pattern is characterized by slowly declining daily activity and the other by a sudden decline in activity that is followed by death.