In order for the regular polygon to map onto itself by a rotation of 45°, it should have a central angle of 45° between lines that connect the vertices to the center.
If the regular polygon has n side, then
360°/n = 45°
n = 360/45 = 8
Answer: An octagon