行く and 来る can be confusing in that they do not correspond exactly to the English go and come, hence 行く, in some situations, would best be translated as come. Most beginner texts will explain when to use 行く and when to use 来る, so try to pay attention to those rules instead of thinking come and go.
I personally am awful at doing that.
Oh yes, and it is a bit of a more advanced grammar point, but a verb in the てform followed by 行く can mean two different things.
1. 掃除をしていく。 To go somewhere after cleaning. When the verb in the て form is a momentary action, て行く means to do the て verb, then go. This is probably the more common usage.
2. 子供のために生きていきたい。 Here the sentence does not, obviously, mean I want to live for my kids and then go, as that makes no sentence. In situations like this, いく is expressing the fact that the verb that procedes it is something that will continue to happen into the future. So, here, the sentence means '(From now on) I want to live for my children.
On a side note, くる can be attached to て form verbs and does similar work. It indicates that something has become more and more something. For example, 寒くなってきた means it has been getting darker and darker, or, more simply, its getting dark.
Both indicate change, but the change is moving in opposite directions.