It is interesting to realise that this is what the Bible says. In Ecclesiastes 4, it says:
Two are better than one, because they have a good return for their work: [more productive] If one falls down, his friend can help him up. [benefit of altruism] But pity the man who falls and has no one to help him up! Also, if two lie down together, they will keep warm. But how can one keep warm alone? [survival strategy] Though one may be overpowered, two can defend themselves. A cord of three strands is not quickly broken. [defensive mechanism]However, it's worth thinking about this in context. The perspective from which this has been written is "under the sun" - that is, in a context of philosophical naturalism. Imagine there's no heaven, no God - well, if that's the case, then this is my analysis of the world. In that context, this sort of analysis of relationships is the only option that we have. Basically, all our relationships are ultimately self-serving.
But the writer is making this point in a kind of ironic way - he also does this with the problem of oppression, toil and advancement in the same chapter. That's not how we view life. We don't have friends simply because they can pick us up when we fall over - although that may be one of the things that they do. We don't have relationships just to help us survive. That's simply not what humans are like. Yes, you can do an analysis of friendship "under the sun" - but it is profoundly unsatisfying because it simply fails to adequately account for our experience.