how do i find out why links point to my old domain

Don’t worry about changing the guid, you’ll be fine if you never update that field. The main places you’ll need to update are in the post_content column of wp_posts (for links and images), and in the wp_options table (for widget data).

Before you do any database replacing, though, read through this thread:

How to: Easily Move a WordPress Install from Development to Production?

There are some helpful tips there, and there are plugins that will do most of the work for you.