I show that persistent underconfidence and overconfidence each arise from the combination of Bayesian learning about one's own abilities and rationally choosing to exert more effort when more confident. If an agent believes that greater effort reliably improves outcomes, then the agent learns...