This neuroimaging study examines the development of cognitive flexibility using the Change task in a sample of youths and adults. The Change task requires subjects to inhibit a prepotent response and substitute an alternative response, and the task incorporates an algorithm that adjusts task difficulty in response to subject performance. Data from both groups combined show a network of prefrontal and parietal areas that are active during the task. For adults vs. youths, a distributed network was more active for successful change trials versus go, baseline, or unsuccessful change trials. This network included areas involved in rule representation, retrieval (lateral PFC), and switching (medial PFC and parietal regions). These results are consistent with data from previous task-switching experiments and inform developmental understandings of cognitive flexibility.