Answer:Acid catalyst is needed to increase the electrophilicity of Carbonyl group of Carboxylic acid as alcohol is a weak nucleophile.
Alternatively esters can be synthesised by converting carboxylic acid into acyl chloride using thionyl chloride(SOCl_{2} and then further treating acyl chloride with alcohol.
Carboxylic acid and esters can be easily distinguished on the basis of IR as carboxylic acid would contain a broad intense peak in 2500-3200cm_{-1} corresponding to OH stretching frequency whereas esters would not contain any such broad intense peak.
Alcohol and esters can also be distinguished using IR as alcohols would contain a broad intense peak at around 3200-3600cm_{-1}
Explanation: For the synthesis of esters using alcohol and carboxylic acid we need to add a little amount of acid in the reaction . The acid used here increases the electrophilicity of carbonyl carbon and hence makes it easier for a weaker nucleophile like alcohol to attack the carbonyl carbon of acid.
The oxygen of the carbonyl group is protonated using the acidic proton which leads to the generation of positive charge on the oxygen. The positive charge generated is delocalised over the whole acid molecule and hence the electrophilicity of carbonyl group is increased. Kindly refer attachment for the structures.
If we simply mix the acid and alcohol then no appreciable reaction would take place between them and ester formation would not take place because the carboxylic acid in that case is not a good electrophile whereas alcohol is also not a very strong nucleophile which can attack the carbonyl group.
Alternatively we can use thionyl chloride or any other reagent which can convert the carboxylic acid into acyl chloride. Acyl chloride is very elctrophilic and alcohol can very easily attack the acyl chloride and esters could be synthesized.
The carboxylic acid and ester can very easily be distinguished on the basis of broad intense OH stretching frequency peak at around 2500-3200cm_{-1} . The broad intense OH stretching frequency peak is present in carboxylic acids as they contain OH groups and absent in case of esters .
Likewise esters and alcohols can also be distinguished on the basis IR spectra as alcohols will have broad intense spectra at around 3200-3600cm_{-1}corresponding to OH stretching frequency whereas esters will not have any such peak. Rather esters would be having a Carbonyl stretching frequency at around 1720-1760