  We present high-frequency ultrasonic measurements on the filled skutterudite
SmOs$_4$Sb$_{12}$ under hydrostatic pressure. The results clarify that the 4$f$
electrons in this compound transform from delocalized at ambient pressure to
localized at high pressures with a crossover pressure of approximately 0.7 GPa.
This drastic change in the 4$f$ electrons under pressure is apparently related
to the non-Fermi liquid state, which appears in an intermediate-pressure range
of 0.5-1.5 GPa. The results or our analysis strongly suggest that the
ferro-octupolar interaction becomes dominant at high pressure. Moreover, we
report the pressure dependence of the ultrasonic dispersion, which is due to
rattling, over a wide range of ultrasonic frequencies up to 323 MHz. The
drastic change in the ultrasonic dispersions and the frequency dependent
elastic anomaly in the $C_{11}$ mode at lower temperatures imply a possible
coupling between rattling phonons and 4$f$ electrons.
