I have set Firefox as default web application in Ubuntu, but external links (like clicking a link in Pidgin) still get opened with Opera. Does anyone have a clue on how to fix this? Thanks.
Default applications are specified in All Settings -> Details -> Default Applications.
If default Web browser is set there to Chrome, but links from other programs are still being opened with previously set default browser, this might be either some sort of a caching issue of Gnome, or 3rd party application - in your case Pidgin.
This is a blind guess, but I think I would try to reboot, and if still no result, would purge Pidgin and then reinstall.
Another option would be to remove Opera. Since you already have your favorite browser, most likely you don't need the other one, unless you have a special reasons for that.
I had similar case - chromium wanted as default browser, but want also keep opera installed. Evince kept opening links in Opera, even I set chromium as default browser with
Also the advice to run strace to see what is happening was useful.