1. $$C_7H_7NO$$, show the high degree of unsaturation, so it can be considered that there may be phenyl group, as phenyl group has 3 double bond.
2. As the compound $$C_7H_7NO$$, when reacts with $$Br_2/KOH$$ , gives the amine Y. It shows that there must be amide group in $$C_7H_7NO$$ compound, as this reaction is Hoffmann Bromamide synthesis.
3. As this amine is synthesized by Hoffmann Bromamide synthesis, it gives carbylamine test, so it means that amine must be primary amine.
4. Now as upon diazotisation this amine forms diazonium salt, also it gives the coupling reaction with phenol to give an azo dye, then it must be aromatic diazonium salt. If it were aliphatic then it would form alcohol by releasing $$N_2$$, and the coupling could not be possible.
So, all these steps show that this is $$C_6H_5CONH_2$$.
Reactions:
1. $$C_6H_5CONH_2 (X) + Br_2 + 4 KOH\longrightarrow C_6H_5NH_2 (Y) + K_2CO_3 + 2 KBr + 2H_2O$$
2. $$C_6H_5NH_2 (Y) + CHCl_3 + 3KOH +\xrightarrow{heat}C_6H_5-NC + 3 KCl + 3H_2O$$.
3. $$C_6H_5NH_2 (Y) \xrightarrow{NaNO_2 + 2HCl (at\ 273-278 K)}C_6H_5-N_2^{+}Cl^- + 2NaCl + 2H_2O$$.
4. $$C_6H_5N_2^{+}Cl^- \xrightarrow {C_6H_5OH /OH-} C_6H_5-N=N-C_6H_5-OH (azo\ dye)$$ .