Our problem lies not in what to do but in how to do it.
Is the underlined "in" optional? If not, why not? If yes, why yes? Thanks.
It is optional because the meaning is still clear and the sentence still sounds okay. But if you want to keep the second "in" keep it. (the sentence also omits the second "lies". no problem)
Thanks, 2006.
You can't just take out the first phrase; the first phrase sets the pattern of thought.
Of course 'Our problem lies how to do it.' doesn't make sense.