It is widely accepted that AGN feedback is the key to solving the cooling flow problem in cool-core galaxy clusters. Recent observations have also found extended multiphase gas and star formation in a significant fraction of cool-core galaxy clusters and massive elliptical galaxies. Using high-resolution 3D simulations, I study the interplay between radiative cooling, AGN feedback, and star formation in the centers of galaxy clusters and elliptical galaxies. I will review the theories on the origin of multiphase structures in these massive systems, including the popular idea of thermal instability/precipitation, and in-situ induced cooling. I will also discuss how AGN deposits its energy to its surrounding medium from both the observational and theoretical perspective. Lastly, I will talk about our recent effort to test AGN feedback models by analyzing mock X-ray observations of simulated clusters.