wifiguru
Sorry, haven't been able to get onto the iMac for a day or two - it's the family machine. Anyway, this evening they are all out so I've had the opportunity to spend some time on it. I thought I would have one last go at the simple thing - removing the wifi network in the Network pane, and then setting up access to it again from first principles, and believe it or not, I am now connected to the internet by both wifi and ethernet. I'll monitor it and see if it reverts to the question mark again, but I've done one restart and it seems to have stuck.
One thing that I did notice is that I signed up to iCloud Keychain a couple of days ago, and now I have a huge list of wifi networks listed in the advanced/wifi pane of the Network preference, from all the networks that I have ever connected to with iPhone, iPad or MacBook Pro. If I try to delete them, a message comes up to say that they will be deleted from my other devices as well, so I've left them there. Did Apple intend to have desktop computers with all these wifi networks linked to them?
Thanks for your help over the past few days