The anterior cingulate cortex (ACC) has been suggested as a monitoring center that is responsible for online detection of response conflicts. In this view, the conflict signal detected by the ACC is transmitted to other brain regions, such as the dorsal part of the lateral prefrontal cortex (lPFC), to increase the level of cognitive control. In this functional MRI (fMRI) study, we examined the conflict resolution that goes beyond online detection of response conflicts. Participants learned pseudoarithmetic problem-solving tasks that involve stimulus-response mapping rules with high or low conflicts. On half of the trials, participants had a preview of the upcoming operator that allowed advance preparation for the mapping rules. The preview significantly reduced the conflict effects on latency. During the preview, both the ACC and lPFC were activated in anticipation of conflict, and this anticipatory activation was highly predictive of the subsequent latency. These results suggest that the ACC and lPFC are responsible for both anticipatory preparation and online adjustment in response to conflicts. The results also confirm the roles of the lPFC and ACC in managing conflict during problem solving and extend these roles to include responding to anticipation of conflicts that may arise between incompatible stimulus-response mappings maintained in working memory during preparation.