Britain's smallest school that has just two pupils will close down at the end of the year after more than half a century at the centre of the community.