I asked this last night on math.stackexchange, but people ask a lot of questions there of varying quality, and I think questions sometimes get lost in the shuffle.

I thought posting the same question here might be useful. It seems like the type of thing people here would find interesting.

It's an inequality, but what I'm much more interested in is not the fact that the inequality is true, but whether I am correct about the necessary and sufficient conditions for the inequality to be an equality.

This seems similar to something I was reading recently on Hölder's Inequalities. One such page was talking about the conditions under which Hölder is an equality, and they derived conditions very similar to what you're proposing, but in the slightly alternate form. Unfortunately, I can't find that paper now; one that seems to be on the same path is here. I don't think it's precisely what you're looking for, but perhaps it will be of some use?

I posted an answer over on math.stackexchange; the crucial observation here is that we can rewrite the left side of your inequality as the dot product of a unit vector and the integral of f (where those two vectors are necessarily in the same direction), and that the dot product of a unit vector and another vector is always less than the latter's absolute value; that is, we can modify the inequality to hold pointwise meaning it obviously holds globally.

Mathematical hangover (n.): The feeling one gets in the morning when they realize that that short, elementary proof of the Riemann hypothesis that they came up with at midnight the night before is, in fact, nonsense.

Yeah, I was about to answer the same, but less rigorously. The right side always measures the magnitude at each point; the left side obviously equals the same if it almost always points in the same direction (sufficient), and if it ever points in another direction (on a measure >0 set of points), it will contribute less than its pointwise magnitude to the total magnitude (necessary).