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.)
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:
He asked, "Which way to the museum?"
If you shift the ? outside the speech marks:
Who said, "I am hungry"?
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.
Best Answer
I'd rather say:
I used a colon or a comma because you're introducing a question that you are asking. I'll explain better:
The first one might be used, I guess, because indirect interrogatives might be written as statements.
A small edit about this last sentence above: @Cerberus made me notice that indirect questions are such with no inversion. So I was thinking that if someone could add others point of views, it would be nice, in order to make this point clear for me and others once and for all. Native speakers are particularly welcome!