As with everything regarding search engines, nobody has a definite answer but for those inside. What is certain is that search engines do not like duplicated content - i.e. the same content under different URLs. Well, one would suppose that they've already learned that example.com and www.example.com are just the same and not duplicated, but they don't tell. As all this costs you nothing, you may as well play it safe and do the redirect.
To force a www in front of your domain name drop these lines into .htaccess:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
The inverse is possible too:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]