+0
Which to say?

How did you know todo that.

How did you know whether to do that.

one more thing

Do you omit the bold part in the next sentences and can you leave it in?

I don't know if I should go or if I should stay.

Can I leave it in?

Thanks
Comments  
alc24I don't know if I should go or if I should stay.
alc24How did you know how to do that?
alc24 How did you know whether to do it or not?
alc24I don't know whether/if I should go or whether/if I should stay.
No, I wouldn't strike it out.
you can say

How did you know to do that? I've heard it.

WHAT DO YOU THINK?

and

you for sure can say

I don't know if I should stay or go.

what I don't know is if its correct and natural to say

I don't know if I should stay or if I should go.

ANYONE ELSE???
Students: We have free audio pronunciation exercises.
alc24How did you know to do that? I've heard it.
I don't think it sounds good, anyway. "How did you know what to do?" is also possible. Without an object I've never seen "to know" being used.
alc24I don't know if I should stay or go.
As I've already told you it sounds O.K.
Following is correct to write:

How did you know to do that.

I don't know if I should go or stay.
It's also okay to say, "I don't know if I should stay or if I should go."
Teachers: We supply a list of EFL job vacancies
alc24How did you know todo that.
OK (as long as you separate the words "to" and "do"). That means that "you" did something and I now want to know how "you" knew that that one specific thing needed to be done.
alc24How did you know whether to do that.
I would interpret the meaning to be that I want to know how "you" made a yes/no decision about doing something. In other words, "you" first debated this: "Should I do it? Or should I not do it?" And then "you" chose between "do it" and "not do it". This question seems to actually be asking "How did you decide on yes vs no?"

The first question does not suggest that "you" debated at all -- "you" simply knew what to do.
alc24I don't know if I should go or if I should stay.
You can omit or retain the second "if I should". It's optional.