An X-ray is a standard procedure for someone with a persistent cough that does not respond to antibiotics.
This said, the majority of coughs are due to viral, not bacterial, infections, therefore antibiotics will have no effect because antibiotics do not kill viruses. However, they are sometimes prescribed in someone elderly because the cause may be bacterial and also to prevent secondary infections, which often are bacterial, from gaining a foothold.
The x-ray may reveal the tell-tale signs of a pneumonia type infection (such as fluid buildup) and also eliminate other possible causes of a cough.
A couple of years ago my mum had a persistent cough that went on for weeks and breathlessness (if you have seen the referral note the doctor has made and it says BAR, this means, Breathlessness At Rest). He ordered an x-ray as routine. This revealed nothing sinister, the only thing that showed were the scars that wer eleft from mum's childhood pleurisy.
A remote possibility is whooping cough, although this usually has the characteristic more severe coughing sessions. As immunity is not life-long, even people who have been vaccinated or had the diease as a child can catch it again. In adults it is usually less severe - in children it causes paroxysmal coughing, often with vomitting. Antibiotics can kill the infection but have little effect on the duration of symptoms, which can go on for months.
As an aside, it's important for any elligibile ot have their pneumonia vaccination. It should be offered as routine to anyone over 60, often with the flu jab. You only need one as it is life-long. It does not grant 100% immunity and is only effective against certain types of pneumonias, but still worth it. Persons with health issues such as asthma may be offered it at any age (I had mine when I was 40)