Styrene reacts with HBr in presence of peroxide to add Br at less substituted carbon. This reaction follows anti-Markownikoff rule.
Product (X) reacts with mathrmMg in dry ether to form Grignard reagent which on treatment with mathrmCO2 followed by hydrolysis gives carboxylic acid.
Y on treatment with PCl5 form acyl chloride. This acyl chloride on reduction with H2; Pd−BaSO4 gives aldehyde and this reaction is known as "Rosenmund reaction."