We describe the structure of ground states and ceiling states for generalized gauge actions on a UHF algebra. It is shown that both sets are affinely homeomorphic to the state space of a unital AF algebra, and that any pair of unital AF algebras can occur in this way, independently of the field of KMS states. In addition we study the subset of the ground states called KMS ∞-states.