Cognitive dysfunctions are highly comorbid with depression. Impairments of cognitive flexibility, which are modulated by the monoaminergic system of the prefrontal cortex (PFC), are increasingly recognized as an important component of the pathophysiology and treatment of depression. However, the downstream molecular mechanisms remain unclear. Using a classical model of depression, this study investigated the effects of social defeat stress on emotional behaviors, on cognitive flexibility in the attentional set-shifting task (AST), and on the expression of extracellular signal-regulated kinase 1 and 2 (ERK1 and ERK2) and their downstream signaling molecules cAMP-response element binding protein (CREB) and brain-derived neurotrophic factor (BDNF) in two subregions of the PFC, the medial prefrontal cortex (mPFC), and the orbitofrontal cortex (OFC). The results showed that stress induced emotional and cognitive alterations associated with depression, including a decreased sucrose intake ratio and impaired reversal learning and set-shifting performance in the AST. Additionally, rats in the stress group showed a significant decrease only in ERK2 signaling in the mPFC, while more extensive decreases in both ERK1 signaling and ERK2 signaling were observed in the OFC. Along with the decreased ERK signaling, compared to controls, stressed rats showed downregulation of CREB phosphorylation and BDNF expression in both the OFC and the mPFC. Further analysis showed that behavioral changes were differentially correlated with several molecules in subregions of the PFC. These results suggested that social defeat stress was an effective animal model to induce both emotional and cognitive symptoms of depression and that the dysfunction of ERK signaling activities in the PFC might be a potential underlying biological mechanism.