Background: Identifying β-cells dysregulation in type 2 diabetes mellitus (T2DM) is crucial. Weight fluctuations are frequently observed during diabetes treatment. However, the relationship between body composition changes and islet β-cell function in individuals with T2DM remains insufficiently investigated. Methods: This retrospective longitudinal study encompassed a cohort of 775 T2DM patients, who underwent body composition measuring using dual-energy X-ray absorptiometry (DEXA) and followed up for a median of 2.29 years. Key metrics included body mass index (BMI), fat mass index (FMI), trunk fat mass index (TFMI), muscle mass index (MMI), appendicular skeletal muscle mass index (ASMI), muscle/fat mass ratio (M/F), and the appendicular skeletal muscle mass/trunk fat mass ratio (A/T) were then categorized and grouped. Insulin, C-peptide, and glucose levels were assessed concurrently following a glucose load. β-cell function included insulin resistance (HOMA-IR), insulin sensitivity (Matsuda index (MI)), and insulin secretion evaluated by HOMA-β and C-peptidogenic index (CGI). Results: Although no significant changes in BMI were observed, patients with T2DM at readmission exhibited higher FMI, TFMI, and ASMI, as well as elevated levels of HOMA-IR, MI, and CGI compared to baseline measurements. And lower MI, higher levels of CGI, and HOMA-IR were observed in BMI increased group. Univariate correlation analysis revealed a negative association between changes in BMI (ΔBMI) and ΔMI, while positive associations were observed in both ΔHOMA-IR and ΔCGI. Among body composition indexes, ΔFMI exhibited the strongest correlation with ΔHOMA-IR (r = 0.255, p < 0.001), and ΔASMI was positively associated with ΔMI and ΔCGI (r = 0.131 and 0.194, respectively). Moreover, increased levels of BMI and FMI were associated with a greater risk of progressive insulin resistance compared to the decreased, whereas the trend was converse in ASMI and A/T. Conclusions: Increased FMI may partially contribute to the deterioration of insulin resistance, while increased ASMI is associated with improved insulin sensitivity and secretion. Maintaining an appropriate BMI and muscle/fat ratio is conductive to prevent the progression of insulin resistance in patients with T2DM.