A question within a sentence should be preceded by a comma, and end with a question mark.
I am wondering, how long has that fish statue been there?
There are three important issues that this committee must address. What was the chairman doing in that YouTube video? is not among them.
If a question is particularly long or complex, then for clarity it could begin with a capital letter.
In the daydreams of my youth I would look at the clouds and wonder, Will I find happiness and fulfillment soon after getting a business administration degree, or must I amortize my well-being return on investment over the next seven to ten calendar years?
The sentence in the original question ends with a subordinate clause that does not, by itself, ask a question (“within which we can leverage our existing knowledge”). This is modifying a noun phrase that is part of the question (“set of simple computational rules”). Therefore, this subordinate clause is part of the original question, and should end with a question mark.
Putting all of this together, I would punctuate the sentence like this:
The question nagging me is, To what extent can we encapsulate all what we observe in nature into a set of simple computational rules, within which we can leverage our existing knowledge?
(Some of this advice is based on The Chicago Manual of Style 15th Edition §6.55 and §6.71.)
Actually, sentences that begin with 'could', 'should', or 'would' are questions and should have a trailing question mark. Your original quote, "Could you please pass me the pepper shaker?", could be answered with a "yes" or "no." Although we usually use this syntax as a command it is not the same as the command "Pass me the pepper shaker," or "Please pass me the pepper shaker."
Etiquette tells us that it is more polite to ask for a response than it is to command a response.
Best Answer
If you put the question mark inside the speech marks, the speech becomes a question. Your example is thus incorrect as 'I am hungry?' makes little sense as a question, unless the person has brain damage and is unaware of his hunger!
A more valid example might be:
If you shift the ? outside the speech marks:
Then the whole sentence is now the question: the speaker is asking who stated that they were hungry.
You only use one punctuation mark when using speech/quotation marks.