Laurenz Casser has an interesting article on the function of pain, which argues that a common view of the biological function of pain, that it exists to inform the organism about damage to the body, is wrong. It's an interesting idea, and nice to have a clear, clean argument about it, even though I think the argument fails completely.
There are quite a few different accounts of biological functions, but they primarily tend to fall into two broad schools, the aetiological (or etiological, if you're American) and the consequentialist (or physiological, as it is also sometimes called). On the aetiological view, to attribute a function to a biological organ or element is to identify a general feature of its overall natural history; on the consequentialist view, to attribute a function to a biological organ or element is to identify a role it currently normally plays in the organism. Or to put it in other words, on the aetiological view, a function is what an organ has historically been selected for by the evolutionary processes, and on the consequentialist view, a function is what currently contributes to the organism in a non-freak-accident way. It's perhaps worth nothing, since it is sometimes forgotten, that in both ways there is a difference between 'a function' and 'the function'. For instance, it's possible that a function of the heart is to make thumping noises -- all it takes is for there to be (on the aetiological view) a history to the heart that makes it so that noise-making contributed to its existence in organisms today by increasing the likelihood of surviving and reproducing or (on the consequentialist view) a role it normally plays in the health and reproduction of the organism today. But even if this were true, we would generally not say that this is the function of the heart, as opposed to circulating blood, because neither of these views requires that all functions are equally central -- that will just depend on the history it has or the role it plays.
Casser's strategy is to argue that neither the aetiological nor the consequentialist approach can adequately deliver an account in which pain's function is to inform of bodily damage. The argument on the consequentialist side looks at the pain modulation system -- i.e., the aspects of organismic function that reduce sensitivity to pain. The claim is that this creates a challenge to the consequentialist that has not been answered: to explain "why a system would purposefully prevent system-relevant information from transmission if it is the system’s function to perform such very transmissions." I confess I don't understand what this is supposed to mean. Casser hasn't established that the system is "purposefully" preventing system-relevant information from transmission, and on the consequentialist view this can't in fact be established until you know how the system's doing this is contributes to the health and reproduction of the organism. On the consequentialist view, there may in fact be no 'why'; this might be an inefficiency or a functional defect rather than a function. And if we do identify a role it plays in the organism's health and reproduction -- Casser mentions in passing the possibility that it may facilitate escape from damaging situations -- then we already have our answer: that is why. The consequentialist is not committed to organisms having a perfectly consistent design, in the sense that organs never work at cross-purposes, even in the normal operation of the organism, and even with themselves. Thus it's entirely possible that the actual pain-giving part serves to inform and that the pain modulation serves to prevent an effect of informing, and that there is a range of situations in which the one is foiling the other; there is no contradiction in this, as long as the two don't balance each other out. But it's not clear that there even need be a cross-purposes here; if System A has a function F and Subsystem B has an opposing function X, the natural hypothesis is that System A's function is F except insofar as some effect of F needs opposition (and, of course, A may fulfill this qualified function more or less badly in a given case). It's unclear why this is not supposed to be enough; Casser's explanation at this point becomes almost wholly metaphorical: the system is "purposefully" not informing, we are considering whether pain is "meant" to have that function, "the pain system isn't primarily interested in informing". Casser does note that consequentialists who have even considered the pain modulation system seem to regard it as irrelevant, but prima facie, the consequentialists seem to be right: it just doesn't seem to be relevant to whether in fact pain has a non-accidental role in which it contributes to the health and reproduction of organisms today.
On the aetiological side, Casser wants to argue that there is no biological evidence that pain has historically been selected to have the function of informing of bodily damage. Casser goes so far as to try to argue that there couldn't be such evidence:
One issue is that one would have to consider the evolutionary pressures at the time pain originated – but when did pain originate? What is the phylogenetic tree one could draw which maps back to the first organisms to feel pain? How would we find out? The other issue is a non-trivial problem of defining pain as a trait we could trace. Is pain simply a phenomenological episode, a hurting experience? Is pain the nociceptive system and relevant brain regions including all relevant subsystems? Is it both? How would we decide what the evolutionary relevant unit is? If one wants to champion AET, one better have some good responses to these questions.
However, this argument makes no sense, because none of these are particularly relevant to the question of gathering evidence. We don't need to know 'when' pain originated; the aetiologist is not committed to there being a particular moment when pain got its function. (This is a common error by critics of such accounts.) The aetiologist is only committed to there being at some point a sufficient stretch of history such that pain's doing a certain kind of thing could affect survival and reproduction enough that that action through that period is a reason for its being common in the population now. It's easy to think of the aetiologist as concerned about the past and the consequentialist as concerned about the present, and in a sense it is true; but, if the consequentialist is interested in the current organism, the aetiologist is equally concerned with the current population (they ask, "Why is this common in the population?"). Aetiologists don't need a time machine to gather their evidence; they just need evidence for what actually spreads or maintains the trait in the population. And contrary to Casser's claim, we do have quite common biological evidence that damage-information is a candidate explanation here; for instance, we know that organisms that lose the ability to feel pain are at massively greater risk of fatal infection from bodily damage. That's how leprosy kills, for instance; the disease itself is not fatal, but lepers in advanced stages don't catch wounds as quickly in ways that are very detrimental to their survival. They might put their hand in a fire without realizing that they've done so until they smell themselves burning. They may cut themselves and never know it, and indeed what usually happens is that lepers, subject to normal wear-and-tear such as we all face, end up with cumulating wounds that are infected by gangrene and similar infections. We see that here is direct evidence that not having the ability to feel pain in cases of bodily damage contributes to dying -- and thus we have evidence that having the ability to feel pain increases the chances of organisms' survival in environments in which bodily damage occurs. As it happens, if we ask what kinds of environments are they in which bodily damage occurs, the answer is 'all of them'. So while the precise historical details are worth studying (e.g., so that we can refine our views), they are less relevant here than you might at first think, because the features that are being discussed (pain, bodily damage) are quite common for a very large variety of organisms and environments. What it all comes down to are the following three questions:
(1) Do we have reason to think that pain-feeling has been in organisms for a long time? The answer to this question is, 'Yes'; the physiologies have not changed so radically that we would have reason to think otherwise.
(2) Do we have reason to think that bodily damage is common in environments in which the relevant populations have been through their history? The answer is, 'Yes', because bodily damage is an immensely common feature of the relations between organisms and almost any environment.
(3) Do we have reason to think that pain-feeling changes operation and behavior with respect to bodily damage in ways that facilitate survival and reproduction in a way sufficiently identifiable that it could spread and be maintained in a population? This is a much trickier question in many ways, but we do have evidence: we know that pain is sometimes associated with bodily damage, and there are situations in which the relevant systems are damaged, and we know that these greatly increase the chances of death through fatal infection, due to failures to take corrective action to bodily damage.
This is surely enough to establish the claim as having some scientific plausibility, not merely armchair plausibility. It is, admittedly, not a proof. It could be that the problems in the case of leprosy and similar things are due in part to something else, which, if it weren't involved in those particular cases, would change the result (e.g., perhaps it's really damage to the sense of touch, not to the sense of pain in particular, that is the real culprit); it could be that we might discover that the effect is easily swamped, so that overall pain in fact has no real statistical influence on survival and reproduction, even if it seems to, or even actually does, in some marginal cases; it could be that we discover that actually the association of pain with bodily damage is generally after-the-fact, so that except in rare cases it is discovering the bodily damage that leads to the pain, rather than vice versa. If the argument were merely that these need to be considered, then of course they should; we need at least to check to get our evidences in proper order. But we do, contrary to Casser, have some evidence for (3), the evidence for the alternatives at present runs from weak to nonexistent, and the damage-information view of pain has become more likely, rather than less, over time, because of these points. It all could be wrong, to be sure, but that would be a matter of actual experimental and observational evidence, not abstract philosophical considerations about whether we even could have such evidence -- we already do have such evidence, however limited and even however misleading it might turn out to be.