Polycystic ovary syndrome (PCOS) is a common endocrine and metabolic disorder affecting women of reproductive age, affecting reproductive health, and increasing the incidence of diabetes mellitus and hypertension. Metabolic syndrome (MetS) is the most common metabolic disorder. Although clinical studies have shown a close association between PCOS and MetS, the molecular mechanisms are unknown. In this study, datasets of PCOS and MetS were obtained from the Gene Expression Omnibus database; differential expression analysis and weighted gene coexpression network analysis (WGCNA) were performed; and gene ontology and Kyoto Encyclopedia of Genes and Genomes enrichment analyses also performed of differentially expressed genes (DEGs). The PCOS- and MetS-coexpressed DEGs were subsequently intersected with the coexpressed genes in the WGCNA module to obtain the core genes. By constructing receiver operating characteristic curves, we verified the predictive effects of the core genes. We also validated the expression of the core genes in the datasets. Finally, we verified the expression of the core genes by quantitative polymerase chain reaction in human follicular fluid granulosa cells. In addition, we used Cell-type Identification By Estimating Relative Subsets Of RNA Transcripts to analyze the immune infiltration of immune cells in PCOS and MetS. Finally, we obtained 52 coexpressed DEGs of PCOS and MetS and 3 coexpressed genes in the WGCNA module. By taking the intersection of coexpressed DEGs and coexpressed genes of the WGCNA module, we get ELOVL fatty acid elongase 7 (ELOVL7) as the core gene. Receiver operating characteristic curve analysis showed that ELOVL7 is a reliable biological marker for PCOS and MetS. The expression level of ELOVL7 in human follicular fluid granulosa cells from PCOS patients was significantly higher than that of controls, as verified by quantitative polymerase chain reaction. This study provides the first evidence of the role of ELOVL7 in developing PCOS and MetS. This gene may serve as a potential diagnostic marker and therapeutic target for both conditions.