The current answer is - trying not to be old.
The current mainstream and approved idea of old age is that it ought to be a time of sport, travel, socialising and sex - the greatest compliment to pay an old person is that they seem (look, behave) younger than they actually are.
Thanks to technology and prosperity, old people do indeed - on average and especially at peak - seem younger than their chronological age would suggest - and celebration and assertion of this fact emphasises there is no doubt that being old has no function.
Biologically, of course, senescence (getting old) has indeed no function (at least, not for the individual) - it is merely an accumulation of damage, with a progressive increase in degenerative pathologies, and an increased probability of death.
Socially, old age has no function; since the elderly are less socially-useful than younger people.
Therefore, so far as mainstream secular society is concerned - old age is wholly a bad thing, except insofar as its effects can be compensated, hidden or delayed.
Yet the guilty secret of The West is that it is the oldest society in the history of the world.
*
So, from a spiritual and Christian perspective; what ought to be the function of old age? Well, CG Jung was on the right lines when he said that the last quarter of the archetypal lifespan (of approximately threescore years and ten) was a time for spiritual matters. In an ultimate sense this is so - ageing brings a kind of enforced simplification of the problem of living - as the errors and evasions of younger life becomes less and less viable.
Young people are wrapped-up in their desires or wrapped-up in The World - they are focused on pleasures and distractions.
Age is a simplification of the problem of living, a distillation towards its essence - even the mental changes of age.
Of course, in this corrupt and inverted culture - the facts and duties of age are resisted with extraordinary stubbornness: at resent, old people are no more spiritual than the young, and indeed perhaps less so. There has been a massive abandonment of the proper function and spiritual responsibilities of ageing.
As always, we must consider the matter in terms of each individual person's destiny, and the purpose that we gain important experiences and learn important lessons: the harshness of lives may be (as I say, in some individuals) harsh lessons in life.
For example; Mental decline with age may be a harsh lesson in inner priorities - a stripping away of capacities, that may be trying to teach the sufferer what is ultimately important, and what is not. Such lessons are needed now more than ever before, since so many people have led entire lives of the most extreme superficiality, evasion, worldliness, materialism and spiritual-denial,
All humans are free agents - and we must assume (since God is Good, our Heavenly parent/s, and has created this world for our progression towards divinity) that this is retained - inwardly, and to a sufficient degree - in everyone. In general we cannot understand the reason why things happen-to other people - but we should Not assume that things happen Only because of bad luck or for purely biologically-determined reasons.
In ourselves, and in those we know or love, we can (if we ask in the right spirit) know the workings of destiny at an individual level; we may sometimes know what is intended. From this perspective, the purpose of ageing is often clear enough.
The fact that the purpose is routinely unacknowledged and denied is a tragedy of our petty and trivial, and increasingly damnation-seeking, civilisation and society.
Old Age is therefore a barometer; a society's qualitative understanding-of and attitude-towards old age is a litmus test of its deep spiritual and religious health.
Unless or until we can learn the meaning and purpose of Old Age - not only in general terms but also but in each specific person we love; and in particular our-own-selves - we are indeed lost, adrift, self-damned,