I don't disagree necessarily, but this is way too subtle for a kid
Too subtle? This is just one tiny part of growing up and learning to interact with other people. If it's too subtle for him at this point in his development, then you'll just have to wait.
so it's not a practical answer
It's a practical answer in that it shows why you shouldn't encourage him to respond like that in those situations. I would have to know a lot more about your kid (and perhaps also way more about parenting) to know whether you should try to discourage it (and how to go about that), but at least we now know that it's not a virtue in itself, but merely a social misunderstanding.
In other words, you were wondering whether to teach him to "lie" upon these occasions. I'm saying that you definitely shouldn't do the opposite (express affirmation to him about what he's doing). That's useful to know, right? About whether you should go about trying to fix this social misunderstanding though, I don't know. Is this normal for his age? Is this part of a trend? Will he simply update later with no bumps in the road? Etc.
You could try just telling him that sometimes "how are you" means that they want a long response about whether he's happy or sad or whatever and why, but sometimes it's just to be friendly and they don't want anything more than a quick "good" or "fine" or whatever. In fact, that simple insight might well launch him into a long, fruitful path of social inquiry and analysis for many years to come.
(If he asks how to know which is which and you don't think you could explain it or he wouldn't understand you, just say it's hard to tell but that he'll get it at some point if he keeps trying.)
Besides, as a semi-professional linguist, I must say you are confusing semantics (e.g. your boxes example) with pragmatics which is what we are talking about, where one uses words to mean something other than what the dictionary + propositional logic say they mean.
How exactly am I confusing those?
These are often very confusing because they rely on cultural context and both kids and foreigners often screw up when they deal with them.
Yes. Actual communication is quite difficult.
(That's sort of sarcastic or something, but it's not supposed to convey bad will; I'm simply trying to clarify my position. The attempt is sort of vague though, so I don't necessarily expect you to know where I'm going with it.)
I've seen an article on LW about Santa Claus and most people were very keen on not lying to their kids (and I agree). I have a little kid who is generally quite truthful, innocent enough not to lie in most cases. I noticed recently that when someone asks him, "How are you", he usually answers in detail because, well, you asked, didn't you? When I was a teenager I hated people who lied and I tended to ignore these unwritten social rules to the extent I could. I.e. I didn't ask if I didn't want to know and people thought I was rude. So, my question is, should I teach him to lie upon these occasions?
More broadly, I was thinking, why am I committed to being truthful, in general? I guess because I would hate to be lied to myself. This is a kind of magical thinking maybe, or maybe it's a part of the social contract. This sort of lying in fact promotes the social well-being because to answer truthfully creates an unwelcome burden on my interlocutor who asked out of politeness and is not in truth interested. But it still feels wrong to lie. Even more wrong to teach your kid to do so.