I believe that Jacob traveled back in time when he visited Kate, Sawyer, etc. By visiting Kate, he got her to promise to never steal again: thus, preventing her from becoming a criminal. When he gave the pen to Sawyer, it allowed Sawyer's uncle (or whoever he was) to get him to promise not to write the letter, thus ending his obsession and preventing him from becoming a con artist. He allowed Nadia to be killed by an accident, thus keeping Sayid from seeking revenge and becoming Ben's assassin. He gave Jin and Sun advice that would keep their marriage intact. He convinced Hugo that he wasn't crazy. He gave Jack confidence, keeping him from the growing issues with his dad.
I don't know what his visit to Locke did. :-(
I don't know what his visit to Locke did. :-(