As a frequent coffee drinker, I can tell when the coffee beans have been over-roasted; the coffee is bitter.
What can I tell when the beans have been under-roasted?
What does under-roasted coffee taste like?
I suppose under-roasting and over-roasting are somewhat relative. I generally prefer a lighter roast (just after the completion of first crack) which might be under-roasted to some tastes.
I've occasionally stopped a roast too early and then it's under-roasted to me (and I suspect anybody else) as well! In those cases, the coffee tastes sour and I don't mean acidic, but sour. The sourness is a little like the taste in bread that has got old and soured. It also has a taste that's reminiscent of tea. I like tea but not when when it's meant to be coffee! (If you've ever had Qishr - "tea" made from the dried coffee cherry husks - it's pretty close to that, which is not surprising I suppose.) There are also other coffee tastes which are just absent from under-roasted coffee - there is simply less of that "coffee" taste (and it also disappears of the tongue very quickly) and the coffee also has less body.
If they are not too under-roasted, I find letting the beans rest a lot longer than normal can help a bit.
I think this discussion should start with the Maillard reaction; known as caramelization.
When the beans are roasted, a chemical reaction activated by heat reduce sugars (more correctly, hydrocarbons) within the beans with the proteins (more correctly, amino acids). During this time, some carbon dioxide is emitted as a result of this process and jailed within the cell structure. During this reaction, many organic molecules within the bean are pyrolysed (chemically separated by fire). Probably at that phase, many aromatic lipids emerge that we are actually tasting and trying to extract during brewing. Note that, more fruity aromas were already in the bean before pyrolysis (or caramelization, Maillard reaction, roasting... You may use interchangeably).
Now, let's reason about under- and over- roasted beans:
If you have under-roasted beans, you have less carbon dioxide. So you have less foam. You have less aromatic lipids, so you have less aroma. But the overall aroma is more fruity.
If you have over-roasted beans, you have so much carbon dioxide. So the cup will sure have a foam. You have aromatic lipids, but probably you have burnt some of the fragile organic molecules on the road. Thus you have a lot of aroma, but the overall aroma will be a bit burnt and bitter.
Edit: I realized that @Geo already explained the Maillard reaction very neatly in a previous answer here.
Vegetal - asparagus, sour; especially on the after-taste/linger as acids sit on the pallette. A good roaster can minimize this as it is often an occurrence of the centre of the bean being undeveloped in the roast. Also some espresso machines which can make temperature alterations during the brew can give a better cup.
Chlorogenic acid is abundant in green coffee. It degrades through the roasting process. If a coffee is underroasted, there will still be a lot of CGA and it will be very acrid and unpleasantly acidic in this regard. Iin underroasted coffee the chemical reactions to yield sweetness were not carried out fully enough.
This is one of the waterloos of too many companies entering the cafe business. They become too gung-ho over the light roast, that they end up serving and turning-off a lot of people with stomach-hurting acidic coffee.