If you had a carbonyl bonded to an O on one side and an OH on the other side, would the whole functional group be an ester or a carboxylic acid?

-COOH is a carboxylic acid.