Origin of "Very Good, Sir!"
It's quite likely you've read a P.G. Wodehouse book. Well, then you'd also know about Jeeves, and something he says quite often:
Very good, sir.
Jeeves is a butler. And he isn't the only one to reply with those words, whenever asked to do something. I've heard many butlers (all in TV shows, or movies, or books) say it. Where did it originate from, though?
Very good in its literal sense is a phrase to indicate approval. How did it come to imply acknowledgement of orders? I tried online, but all I got was usage, not origin.
OED has this under good:
4c. absol. as an exclamation, expressing satisfaction. Also (chiefly Austral. and N.Z.) good-oh!, good-o!, goodo!, etc., when the same words are used as adjs. = good, A. 4 and advs. = ‘well’.
1829 F. Marryat Naval Officer III. iv. 101 Very good, my lord.
The OED quote doesn't give any context, and it could simply be a reaction to a particularly good clay-pigeon shot. However, it's available online:
He was very particular and captious when not properly addressed. When an order is given by a commanding officer, it is not unusual to say, "Very good, Sir;" implying that you perfectly understand, and are going cheerfully to obey it. I had adopted this answer, and gave it to his lordship when I received an order from him, saying "Very good, my lord."
Mildmay (the narrator) explains the usage; but in terms of the OED definition it simply means that the speaker is satisfied that he understands and has everything he needs to fulfil the request.
It's just another way of saying 'very well', which is still used by educated people (in the UK), usually as a response. You'd usually hear 'very good' or 'very well' in certain circumstances - perhaps there's been a discussion or argument about whether doing something is a good idea or not, and the person who originally argued it wasn't changes their mind and then agrees to comply by saying 'very well' or 'very good'. In practice, only 'very well' has survived, it's rare to hear very good in any other sense than the modern one which you quote in your question. An older relative of mine, when his wife announced she was going shopping or whatever, would respond with 'very well'. I heard 'very well' recently - it was, this time, following an argument, and the father eventually, once agreement between the two parties had been reached, said 'very well then, that's what we'll do', but he could have said 'very good, then that's what we'll do' and its meaning would be the same, which is more or less'so be it'.
UPDATE FOLLOWING COMMENT: I can't see why it's difficult to work out the origin - as a phrase, it doesn't have an origination, it's the component parts, that is 'very' and 'good'. Since 'good' and 'well' were once synonymous (but not necessarily in modern usage), 'very good' is the same as saying 'very well' in these circumstances. In the UK, when asked how we're feeling, we may answer 'very good' or 'very well', so even now, the use of 'good' and 'well' can be interchangeable. Either way, 'very good sir' still means 'I comply' or 'so be it', as it always has.