The first time I remember this question, and seriously thought about it, was in the form of, "Can God create a mountain too large for God to move?" It's a self-contradicting statement when concerning and all-powerful God, and is designed to "trip up" the believer and, I suppose, suggest the idea of an all-powerful entity is incoherent. And the correct answer, I believe, is that, yes, in theory He could, but He would not because He is a God that makes sense, so it is not an issue about what the outcome would mean.
But a more interesting question, I think, is this, "Can God lie?" This was a question we discussed at a recent small group meeting. And the automatic answer for most Christians I think is, "No." And this is technically true I think, and scripture supports the notion. But, I think the real interesting part is the source of this limitation. Typically the response will be that it is due to His nature: God is pure "good", therefore cannot lie (which is a sin after all).
But my thought on this is that then becomes some external limitation, thus God is suddenly NOT all powerful because there is something He cannot do! And certainly Satan does not have some power that God does not. Jesus said, "You are of your father the Devil, and you want to carry out your father’s desires. He was a murderer from the beginning and has not stood in the truth, because there is no truth in him. When he tells a lie, he speaks from his own nature, because he is a liar and the father of liars." (John 8:44) So certainly Satan has the power to lie, and he does so of his own accord ("from his own nature"), not caused by God to do so. So we are left with either Satan has some ability that God does not, or God has the ability to lie.
So my thought, and I don't know if scripture suggests the source of why God "cannot" lie, is that this is a self-imposed restriction placed upon Himself by Himself. In other words, God cannot lie because He has decided He won't.
I would further argue that due to God's role of being the definition of perfection and truth, even if He did lie, His lie, from our perspective, would become truth, from our perspective. In other words, if God were to say the color red is actually the color blue, because He is the manifestation perfection and truth it would be so for us! I certainly do not think that is the case, there is nothing in scripture to suggest God plays this sort of "tricks", in fact quite the opposite: "For God is not a God of confusion but of peace. [...]" (1Cor 14:33) Nevertheless, I think it is an interesting thought.