Why prefix a request with "I'm going to have to ask you..."

Solution 1:

I'm sure you suspect the answer: The preferred phrasing is more subservient and less demanding (a role many waiters at fancy restaurants are encouraged to play) even though they mean the same thing.

Sir, I'm going to have to ask you to put out your cigar.

The previous sentence carries a few implications. One might expand it to:

Sir, I would never ask this if it was up to me, but those damn rules they make me follow FORCE ME to ask that you please put out your cigar. I don't blame you, of course.

That is, it's implied that the person asking isn't personally bothered by your cigar; he's just forced to ask you to stop by company policy.

In a less fancy resturant, one might say:

Sorry, but we don't allow smoking in here.

This is the same exact idea. "It's not up to me; it's company policy, sorry!"
It may seem silly (and it is, in some sense), but it probably does help the customer not feel like an idiot!

Solution 2:

This has to do with what is called Politeness.

It's the same phenomenon that happens in those signs that say "Thank you for not smoking." which is very different from "No smoking." The meaning is the same, but the way the command is uttered is very different, and its effect on people is different as well.

All of this is linked to indirectness: in some cultures, indirectness is associated with politeness (such as ours). You perform something, like an order in your case, but indirectly. "I'm going to have to ask you to put out your cigar, sir" is more indirect than saying "Sir, please put out your cigar."