A report on an event where James Cameron discussed the science of Avatar with some Caltech Physicists gives his own comments on the floating mountains:
Cameron admitted the film never explains exactly what unobtanium is
for, but that it seems to act as a superconductor at room temperature
whereas, in the known world, all known superconducting substances must
be cooled way below the freezing point of water. This makes unobtanium
extremely valuable back on Earth, hence the drive to expand mining
operations on Pandora.
Some of the most spectacular visual effects -- like floating mountains
-- were inspired by possibilities drawn from nature. Pandora possesses a large molten core, which generates a powerful magnetosphere. As
Cameron explained, in a powerful magnetic field, the superconducting
unobtanium levitates. So if you have mountains rich in unobtanium, you
can have the floating Hallelujah Mountains of Pandora (visually based
on the Huang Shan mountains of China.) Although, as Cameron admitted,
to do that a magnetic field would have to be strong enough to rip the
iron from the hemoglobin in your blood. But for the sake of the film,
in this instance he was willing to compromise on the science.
In real life, superconductors exhibit the strongest possible form of diamagnetic levitation (where they are repelled by, rather than attracted to, an external magnetic field--see here for a good explanation), due to the fact that superconductors have zero eletrical resistance, which gives them what physicists call "perfect" diamagnetism (or superdiamagnetism), with the smallest possible magnetic susceptibility of -1. As explained on the superdiamegnetism wiki page, as well as on this page, this feature of zero electric resistance is considered distinct from the Meissner effect mentioned in Tango's answer, which causes the inside of the superconductor to have zero magnetic field.