The resolution to lose weight by cognitive restraint of nutritional intake often leads to repeated bouts of weight loss and regain, a phenomenon known as weight cycling or "yo-yo dieting". A simple mathematical model for weight cycling is presented. The model is based on a feedback of psychological nature by which a subject decides to reduce dietary intake once a threshold weight is exceeded. The analysis of the model indicates that sustained oscillations in body weight occur in a parameter range bounded by critical values. Only outside this range can body weight reach a stable steady state. The model provides a theoretical framework that captures key facets of weight cycling and suggests ways to control the phenomenon. The view that weight cycling represents self-sustained oscillations has indeed specific implications. In dynamical terms, to bring weight cycling to an end, parameter values should change in such a way as to induce the transition of body weight from sustained oscillations around an unstable steady state to a stable steady state. Maintaining weight under a critical value should prevent weight cycling and allow body weight to stabilize below the oscillatory range.