In Parent chain choosing should one consider longest chain or chain with more substituents? Should one take the longest chain or the one containing the prefix/suffix with most priority.Moreover if a shorter chain has two units of the main prefix will it be taken as parent?

examples:

2-ethyl butanoic acid or 
3-carboxy pentanoic acid
The most important simplified criteria for the choice of a principal chain are:


greater number of substituents corresponding to the suffix (principal characteristic group)
longest chain
greater number of multiple bonds
lower locants for suffixes
lower locants for multiple bonds
greater number of prefixes
lower locants for prefixes
lower locants for substituents cited first as a prefix in the name


The corresponding wording of the rules taken from Nomenclature of Organic Chemistry – IUPAC Recommendations and Preferred Names 2013 (Blue Book) is as follows.


  P-44.1 SENIORITY ORDER FOR PARENT STRUCTURES
  
  When there is a choice, the senior parent structure is chosen by applying the following criteria, in order, until a decision is reached. These criteria must always be applied before those applicable to rings and ring systems (see P-44.2) and to chains (see P-44.3). Then criteria applicable to both chains and rings or ring systems given in P-44.4 are considered.
  
  P-44.1.1 The senior parent structure has the maximum number of substituents corresponding to the principal characteristic group (suffix) or senior parent hydride in accord with the seniority of classes (P-41) and the seniority of suffixes (P-43).
  
  (…)
  
  P-44.3.2 The principal chain has the greater number of skeletal atoms [criterion (b) in P-44.3].
  
  (…)
  
  P-44.4.1 If the criteria of P-44.1 through P-44.3, where applicable, do not effect a choice of a senior parent structure, the following criteria are applied successively until there are no alternatives remaining. These criteria are illustrated in P-44.4.1.1 through P-44.4.1.12.
  
  The senior ring, ring system, or principal chain:
  
  (a) has the greater number of multiple bonds (P-44.4.1.1);
  
  (b) has the greater number of double bonds (P-44.4.1.2);
  
  (…)
  
  (h) has the lower locant for an attached group expressed as a suffix (P-44.4.1.8);
  
  (…)
  
  (j) has the lower locant(s) for endings or prefixes that express changes in the level of hydrogenation, i.e., for ‘ene’ and ‘yne’ endings and ‘hydro/dehydro’ prefixes (P-44.4.1.10);
  
  (…)
  
  P-45.2.1 The preferred IUPAC name is based on the senior parent structure that has the maximum number of substituents cited as prefixes (other than ‘hydro/dehydro’) to the parent structure.
  
  P-45.2.2 The preferred IUPAC name is based on the senior parent structure that has the lower locant or set of locants for substituents cited as prefixes (other than ‘hydro/dehydro’) to the parent structure.
  
  P-45.2.3 The preferred IUPAC name is based on the senior parent structure that has the lower locant or set of locants for substituents cited as prefixes to the parent structure (other than ‘hydro/dehydro’ prefixes) in their order of citation in the name.
  
  (…)


You have already found the principal characteristic group, i.e. the carboxylic acid group $\ce{{}-(C)OOH}$ that is expressed as suffix ‘oic acid’.

According to Rule P-44.1.1, the principal characteristic group (suffix) has to be considered first in order to decide the parent chain for this compound. Only the second rule (P-44.3.2) is looking at the longest chain.

Therefore, the name of the first example that is given in the question is 2-ethylbutanoic acid rather than ‘3-carboxypentane’ since the principal characteristic group has to be considered before the longest chain.



Note that, according to Rule P-44.1.1, the parent chain has the maximum number of substituents corresponding to the principal characteristic group (suffix). Also note that the second example that is given in the question contains two carboxylic acid groups. 

Therefore, the name of the second example is 2-ethylbutanedioic acid rather than ‘3-carboxypentanoic acid’ since the maximum possible number of substituents corresponding to the principal characteristic group has to be considered before the longest chain.