We study the inference and experimentation problem of an agent in a situation where the outcomes depend on the individual\'s intrinsic ability and on an external variable. We analyze the mistakes made by decision-makers who hold inaccurate prior beliefs about their ability. Overconfident individuals take too much credit for their successes and excessively blame external factors if they fail. They are too easily dissatisfied with their environment, which leads them to experiment in variable environments and revise their self-confidence over time. In contrast, underconfident decision-makers might be trapped in low-quality environments and incur perpetual utility losses.