Nomenclature rules are complex. We will only attemp to give names to relatively simple molecules. Look at the following examples of representative molecules bearing carboxylic acid groups.
The carboxylic acid function is always, with very scant exceptions, the main functional group.
As usual, one should select the longest possible chain containing the carboxylic acid group and the most part of the remaining functions.
The sufix "oic" or "carboxylic" is added to the name of the main chain.
The numbering of the chain starts by the carboxylic acid group.