Random forest (RF) helps to solve problems such as the detection of sleep apnea (SA) by constructing multiple decision trees, but there is no definite rule for the selection of input features in the model. In this paper, we propose a SA detection method based on fuzzy C-mean clustering (FCM) and backward feature rejection method, which improves the sensitivity and accuracy of SA detection by selecting the optimal set of features to input to the random forest model. Firstly, FCM clustering is performed on the RR interval features of ECG signals, and then the backward feature rejection method is used to combine the intra-cluster tightness, inter-cluster separation and contour coefficient metrics to eliminate redundant features to determine the optimal feature set, which is then inputted into the RF to detect SA. The experimental results of this method on Apnea-ECG database data show that the SA detection accuracy is 88.6%, sensitivity is 90.5%, and specificity is 85.5%, and the algorithm can adaptively select a smaller number of more discriminative features through FCM to reduce the input dimensions and improve the accuracy and sensitivity of the RF model for sleep apnea detection.