When a user goes from one page to another, how can I see where they came from and where they are going? I need to hook into whenever a user moves from one page to another. I need to know where they are coming from and where they are going. My scenario is that anytime that a user heads to a certain section of the site (search) it modifies the path to add a variable. But I only want to to do so when they are coming from outside that section of the site.

I have been looking at hook_url_inbound_alter() which gets me in when a user is about to move to another page, and gives me where they are going, but not where they came from. Any suggestions?
Drupal does not track this information, so you need to do it yourself, using sessions (*).

If your pages are not being cached, then the best place to track user progress would probably be in hook_init. This is called very early on in the process - so in effect you have the information of knowing where the user wanted to go before anything is displayed (you could redirect the page at that stage for instance).

If your pages are being cached, in particular using a cache mechanism that bypasses Drupal such as Boost or an external cache proxy, then you will need a Javascript based solution that sends the information back to your site. How to implement this is beyond the scope of this answer.

(*) Note however that Drupal implements it's own session handling, so you need to do some extra work to use session variables (the session variables you set are only available through $_SESSION on the next page load - in the mean time you need to keep track of them yourself. Some people have written example implementations, or you may want to try the session api module).