verb stem + にいく
If a person moves to another place in order to do something, we can describe their movement and its purpose this way:
destination of movement に/ へ the purpose of movement に いく/くる/かえる
The purpose of movement can either be a noun or a phrase with a verb, its object and so forth. Verbs describing the purpose of a movement must be in their stem forms.
デパートにかばんをかいにいきました。 I went to a department store to buy a bag.
メアリーさんはにほんににほんごをべんきょうしにきました。
Mary has come to Japan to study Japanese.