How to recognize a tubeless tire? I suspect that the used bike I want to buy might have a tubeless tires, but one is flat. Is there any external feature to look at that would allow easily to tell this for sure?

I have no experience with tubeless tires and would not know how to replace it.
While your question of identifying a tubeless tyre has been answered, I think that might not actually be what you have to worry about. A bike might come with tubeless tyres, but that doesn't mean that they're set up tubeless. The tyres might still have a tube in them, so your concern should be identifying whether there's a tube inside or not. The easiest way to do that is to look at the valve stem, because a tubeless valve will almost always be secured with a substantial lockring, whereas a tube with a presta valve might have a little silver lockring or usually nothing at all. Any wheel with a Schrader valve is almost certain to have a tube in it as tubeless Schrader setups are extremely rare. This isn't foolproof, because some people will put a big lockring on a tube and some might put a small one on a tubeless valve, but I'm confident that this will be accurate over 95% of the time.

Schrader valve: 



Presta valve (tube):



Tubeless presta valve: