Do you always try to avoid harm to yourself?
No; if I can help someone else (or my future self) enough by harming myself or risking harm, I'll do so. Example: Giving a significant sum of money to someone in need, when I don't have an emergency fund myself.
Is something being harmful necessary for you to avoid it/avoid doing it to others?
No, there are other reasons that I avoid doing things, such as to avoid inconvenience or temporary pain or offending people.
Is it sufficient?
I use a modified version of the logic that I use to determine whether I should harm myself to decide whether it's worth it to harm others. I generally try to err on the side of avoiding harming others, because it's harder to estimate the effect that a given harm will have on their life than it is to estimate its effect on mine.
Does this just apply to you? All humans? AI? Animals? Plants? Thermostats? Futons?
My definition is meant to be general enough to cover all of those, but in each case the meaning of 'function' has to be considered. Humans get to determine for themselves what it means to function. AIs' functions are determined by their programmers (not necessarily intentionally). In practice, I consider animals on a case-by-case basis; as an omnivore, it'd be hypocritical of me to ignore that I consider the function of chickens to be 'become tasty meat', but I generally consider pets and wild animals to determine their own functions. (A common assigned function for pets, among those who do assign them functions, is 'provide companionship'. Some wild animals are assigned functions, too, like 'keep this ecosystem in balance' or 'allow me to signal that I care about the environment, by existing for me to protect'.) I lump plants in with inanimate and minimally-animate objects, whose functions are determined by the people owning them, and can be changed at any time - it's harmful to chop up a futon that was intended to be sat on, but chopping up an interestingly shaped pile of firewood with some fabric on it isn't harmful.
Is something other than help and harm at work in your decision making?
In a first-order sense, yes, but in each case that I can think of at the moment, the reason behind the other thing eventually reduces to reducing harm or increasing help. Avoiding temporary pain, for example, is a useful heuristic for avoiding harming my body. Habitually avoiding temporary inconveniences leaves more time for more useful things and helps generate a reputation of being someone with standards, which is useful in establishing the kind of social relationships that can help me. Avoiding offending people is also useful in maintaining helpful social relationships.
You don't have to answer all of these, obviously, just give me an idea of what I should see if something is harmful so I can actually check to see if your definition works. Otherwise you can't be wrong.
In a first-order sense, yes, but in each case that I can think of at the moment, the reason behind the other thing eventually reduces to reducing harm or increasing help.
So If I am in extraordinary pain it would never be helpful/ not-harmful for me to kill myself or for you to assist me?
Also, where does fulfilling your function fit into this? Unless you function is just increasing functionality.
Finally, I guess you're comfortable with the fact that the function of different things is determined in totally different ways? Some things get to determine th...
Tyler Cowen argues in a TED talk (~15 min) that stories pervade our mental lives. He thinks they are a major source of cognitive biases and, on the margin, we should be more suspicious of them - especially simple stories. Here's an interesting quote about the meta-level: