First-principles molecular dynamics has been used to investigate the structural, vibrational, and energetic properties of formic acid, formic acid-formate anion dimers, and liquid formic acid in a periodically repeated box with 32 formic acid molecules. We found that in liquid formic acid the hydrogen-bonded clusters mainly consist of linear branching chains. From our simulation, we got good agreement with the available structural and dynamical data. We also studied the proton transfer in the cis-formic acid-formate anion dimer, and we showed that this proton transfer does not have any potential barrier. The hydrogen bonding statistics as well as the mean lifetime of the hydrogen bonds are analyzed.