Federated learning (FL) is a machine learning paradigm in which many users collaboratively train a model under the supervision of a central server (CS). Because the model performance is highly dependent on user quality, user selection becomes a critical issue in FL. In this paper, we develop a system model where the CS aims to select users with high computational power and valuation of the global model. In this regard, we propose an incentive mechanism to motivate users to reveal their computational power and model valuation. Then, we formulate a cost-minimization optimization problem of the CS and propose a polynomial-time dynamic programming algorithm to solve it. The proposed scheme effectively avoids the free-rider problem in which a user with little contribution can obtain the model by joining the FL process. Moreover, utilizing auction theory, our mechanism incentivizes users to report their computational power and model valuation truthfully. Finally, extensive theoretical analysis and numerical simulation validate the superiority of the proposed mechanism compared with two state-of-the-art user selection mechanisms.