An organic compound A of molecular formula C2H6O is a constituent of wine and beer, so it must be an alcohol containing molecule, i.e. ethanol (CH3CH2OH).
When ethanol is treated with alkaline potassium permanganate, it oxidizes ethanol and forms compound "B" which is ethanoic acid.
Due to the formation of ethanoic acid, blue litmus turns red.