A fitness function, in short, is a way of measuring the goodness (fitness) of something in an objective way. To relate this to something tangible: a fitness function of the 100m sprint would be the time needed to complete it. When playing a computer game the fitness of the player might be calculated as the number of monsters he kills, or the fastest lap time he drives in his racecar, or the end result of a strategy game (chess, warcraft, anything). The function gives you a way to compare between two things so you can decide which one of them is better.
This concept is one of the things that comes back in genetic algorithms and evolution. The virtual fitness function of life determines which species survives and which dies, according to Darwin's rules of survival of the fittest. On an ever-changing scale with ever-changing measurements, species that once were unfit suddenly have a chance to survive, and species that were the top scorers in the previous generation suddenly can no longer survive. Nature does not always select on traits that 'we humans' believe are important, like intelligence, beauty or fuel economy. And that's the reason why there are still so many fat stupid ugly people in this world.
So what is the fitness function of life? Or, more specifically, what criteria do individual people use to evaluate their performance as a human being? How do they decide if they are happy or unhappy? What mathematical sum drives people to happiness, or unhappiness? This must be different from person to person, and each person will assign different weights to many factors in the neural network that is their brain. 'Normal' people, that is: people who are part of a modern first-world society, might weight highly factors such as the amount of friends you have, the yearly salary you earn, your outward appearance (your looks) and your outward confidence level. Depending on the purpose of the evaluation (target: girlfriend, or target:employee, or target:co-worker) they weight these factors differently, and they assign you a number. If you consider all the possible evaluations, and all the people currently living on the earth, you will eventually reach an average number that can be used to represent the score of all evaluations of all people. That number is 42.
Joking aside, this is in fact what happens. People have a habit of measuring each other's capabilities or attributes to make it easier for them to deal with a large amount of people without getting too personal. Even in close personal relationships it's easy to fall back to this system of classification. What people sometimes forget is that not everybody uses the same factors and the same weights to evaluate someone. This can be exceptionally frustrating when dealing with someone who handles different criteria. I've been in plenty of situations where there are three people, and each person hates at least one of the other two, but gets along fine with the other. Human relations, fascinating and frustrating at the same time.
I think my own criteria are quite different from other people's. Other people tend to judge people by the rules of society, but I don't really like those rules myself, so I tend to value other people highly if they don't stick to society's rules so much, whereas other people will think less of them. I'm particularly against things like fashion, brand-name articles and useless expenses, which is usually seen as a plus. Sometimes people who care about these things assume that I am poor, or that I don't want to enjoy my life, simply because I do not have many luxury articles. I hope that I have hereby proven that this is just an example that we have different fitness functions for life, and that they''re simply too stupid or self-centered to see my point of view. Then again, self-centered-ness might be a plus on some people's fitness function ;)
As a programmer I tend to relate concepts in programming to the real world, particularly if they're related to neural networks or genetic algorithms. It's my little way of simplifying life. Other people have their religions, I feel safe in thinking that people's brains are just neural networks whose output parameters could be predicted perfectly if we knew the exact input parameters. If you look at how closely the fitness function concept maps to reality, I think that it is a worthy hypothesis, which I hope to investigate further in the future.