We study the cases of equality and prove a rigidity theorem concerning the 1-Bakry-Émery inequality. As an application, we prove the rigidity and identify the extremal functions of the Gaussian isoperimetric inequality, the logarithmic Sobolev inequality and the Poincaré inequality in the setting of RCD(K, ∞) metric measure spaces. This unifies and extends to the non-smooth setting the results of Carlen-Kerce [20], Morgan [43], Bouyrie [19], Ohta-Takatsu [44], Cheng-Zhou [23].Examples of non-smooth spaces fitting our setting are measured-Gromov Hausdorff limits of Riemannian manifolds with uniform Ricci curvature lower bound, and Alexandrov spaces with curvature lower bound. Some results including the rigidity of the 1-Bakry-Émery inequality, the rigidity of Φ-entropy inequalities are of particular interest even in the smooth setting.