Nucleic acids are organic biomolecules that contain heterocyclic rings. They are composed of nucleotides which contain a nitrogenous base, pentose sugar, and phosphate group. Nucleotides polymerize to form long chains with phosphodiester bonds between the sugar and phosphate groups. There are four nucleotides in DNA: adenine, cytosine, guanine, and thymine. Nucleic acids function to store and transfer genetic information, with DNA controlling cellular functions and RNA involved in protein synthesis.