Metacognitive functions are important for both teachers and students to facilitate teaching and learning. The prefrontal cortex (PFC) plays a proven role in metacognition. As a pilot study, we evaluated the PFC activity of teachers and students using near-infrared spectroscopy devices to explore the neural mechanism of PFC underlying metacognitive function during teaching and problem-solving processes. In 14 student-teacher pairs, participants in the teacher role gave hints via a tablet screen to facilitate solving of a tangram puzzle task by participants in the student role. The PFC activity of teachers increased after giving hints but not while planning hints. The PFC activity of students increased upon task solving after receiving hints. The PFC of teachers might play a metacognitive role in monitoring their own teaching results. The PFC activity of students might be related to the creativity process after gaining insights, as well as metacognitive process for monitoring their own behavior.