We discuss the f(R) gravity model in which the origin of dark energy is identified as a modification of gravity. The Noether symmetry with gauge term is investigated for the f(R) cosmological model. By utilization of the Noether Gauge Symmetry (NGS) approach, we obtain two exact forms f(R) for which such symmetries exist. Further it is shown that these forms of f(R) are stable.