How would you be able to recognise that C5H8 was an alkyne?

And how would you know that CH3COCH3 was a ketone? (I thought it was an ether)

the carbon should contain 4 bonds. so CH3COCH3 means that the middle carbon is double bonded to oxygen to make 4 bonds (one bond to each CH3 and double bonded to Oxygen). In ether, the Carbon is single bonded to the oxygen, which will have something like CH3CH2OCH3.

for alkyne, the general formula is CnH2n-2. So, in C5H8, it suit the general formula for the alkyne so it is an alkyne.