Are「どこにも行く時に必ず携帯電話を持って行きます」and「どこもに行く時に必ず携帯電話を持って行きます」grammatical?


> どこに行く時にも必ず携帯電話を持って行きます
>
> Book translation: when I go anywhere, I always carry my mobile phone.

**A)** どこもに行く時に必ず携帯電話を持って行きます

Reasoning: the place is denoted by `どこ`, which is a [interrogative
word](https://books.google.com.mx/books?id=CUXRAgAAQBAJ&pg=PT239&dq=%E3%81%A9%E3%81%93%20is%20an%20interrogative%20word%20japanese%20grammar&hl=en&sa=X&ved=2ahUKEwiAys-T0sDzAhUvTjABHf08BqUQ6AF6BAgLEAM#v=onepage&q=%E3%81%A9%E3%81%93%20is%20an%20interrogative%20word%20japanese%20grammar&f=false)
and, because of that, it can [follow も to mean
'all'](https://books.google.com.mx/books?id=CUXRAgAAQBAJ&pg=PT350&dq=After%20an%20interrogative%20word%20\(%2B%20a%20noun%20\(%2B%20a%20particle\)\)%20to%20mean%20%27all%27&hl=en&sa=X&ved=2ahUKEwiT5JDZ0sDzAhWjtTEKHRwPA88Q6AF6BAgMEAM#v=onepage&q=After%20an%20interrogative%20word%20\(%2B%20a%20noun%20\(%2B%20a%20particle\)\)%20to%20mean%20%27all%27&f=false),
so `どこもに行く` means 'to go anywhere'. However, I suppose 'anywhere' is not a
place you can go.

**B)** どこにも行く時に必ず携帯電話を持って行きます

Reasoning:
[どこにも](https://jisho.org/search/%E3%81%A9%E3%81%93%E3%81%AB%E3%82%82) is an
adverb, meaning 'anywhere' if used with a positive verb.

* * *

I'm also not sure why `どこに行く時にも` is grammatical to start with. That's probably
why I asked this question.




> A) どこもに行く時に必ず携帯電話を持って行きます
>
> B) どこにも行く時に必ず携帯電話を持って行きます

They are both ungrammatical, and it has to be either どこに行くときにも (as you
mentioned) or どこに行くときも.

「どこにも」is usually used with negation:

  * 「鍵を探しているけど、どこにもない。」"I am looking for the key but [the key] isn't anywhere"
  * 「私の居場所はどこにもないんだ。」"I don't belong anywhere"

