WordPress plugin add_filter returning a link does not work. What is the correct way?

The reason the link isn’t working is because you haven’t formatted it correctly.

This:

return '<h3><a href="www.google.com">Hello World</a></h3>'.$content;

Should be this:

return '<h3><a href="https://www.google.com/">Hello World</a></h3>'.$content;

To answer your other question: There are a lot of social sharing plugins that will add sharing links to your content.