How can we be sure that we have identified very distant stars correctly?
We determine the spectral type (i.e. temperature) of a star using multicolour photometry, or (ideally) spectroscopy. By guesstimating the temperature, mass and radius of a star, we can say that two stars that have pretty similar observational properties probably are closely related to each other.

Cepheid variables, for example, display periodic pulsations that depend quite strongly on their intrinsic luminosity -- this is why they're reasonably good standard candles. Their characteristic variability makes them clearly identifiable as a Cepheid, and observations of their pulsation are backed up by data that place them in the same region of the HR diagram.

If it looks like a duck, swims like a duck, and quacks like a duck, then chances are it's a duck. If it's as hot as a Cepheid and pulsates like a Cepheid, then it probably is a Cepheid.

So to answer your final paragraph: yep. Though with no spatial resolution and often (in the absence of parallax measurements) only tenuous distance data, classifying stars is a rather messy business.