many seo site recommend to do a .htaccess 301 redirect from example.com to www.example.com because they say if you have 50 links to example.com and 100 links to www.example.com then search engine wiil count it 150 links to www.example.com because of this redirect. But there are some many who say search engines can penalize these sites. What should i do.
I think that search engines count example. com and www. example.com as two different sites, i'm not sure. What i think will happen is there will be drop for a bit but soon they will figure out that the links point to the same site and your ranking should go up. I could be wrong.
You just do a 301. Google will treat then both domains as the same. You can also specify your prefered domain in Google webmaster tools, without need to redirect.
It will not hurt. It can only help. Allowing your pages to be rendered and indexed using multiple URLs is a BAD thing from an SEO perspective. It leads to split PageRank/link juice and duplicate content. If you don't understand this then I would suggest you read the following post: http://www.canonicalseo.com/url-canonicalization/