A dealer MUST by law tell you if a car is any category of write off. However, 6 months is a long time to notice this. It should be written on the vehicle registration document on the front page near the bottom?
If you are still concerned, then you must, in the first instance, get proper advice from Consumer Direct and follow their guidelines as it is through them that any cases are forwarded to Trading Standards for investigation.
If you saw the car advertised on Autotrader then you should report the dealer to them.