Localizing the brain regions affected by tasks is crucial to understanding the mechanisms of brain function. However, traditional statistical analysis does not accurately identify the brain regions of interest due to factors such as sample size, task design, and statistical effects. Here, we propose a hypergraph-based multitask feature selection framework, referred to as HMTFS, which we apply to a functional magnetic resonance imaging (fMRI) dataset to extract task-related brain regions. HMTFS is characterized by its ability to construct a hypergraph through correlations between subjects, treating each subject as a node to preserve high-order information of time-varying signals. Additionally, it manages feature selection across different time windows in fMRI data as multiple tasks, facilitating time-constrained group sparse learning with a smoothness constraint. We utilize a large fMRI dataset from the Human Connectome Project (HCP) to validate the performance of HMTFS in feature selection. Experimental results demonstrate that brain regions selected by HMTFS can provide higher accuracy for downstream classification tasks compared to other competing feature selection methods and align with findings from previous neuroscience studies.