'I haven't a car'
Can I use this sentence in a formal writing or is it just an informal speaking use?
It is formal and rather old-fashioned. Almost everyone I know would use "I don't have a car" or "I haven't got a car".
Remember - if you don't use correct capitalisation, punctuation and spacing, anything you write will be incorrect.