  Heterogeneous diffusion processes can be well described by an overdamped
Langevin equation with space-dependent diffusivity $D(x)$. We investigate the
ergodic and non-ergodic behavior of these processes in an arbitrary potential
well $U(x)$ in terms of the observable---occupation time. Since our main
concern is the large-$x$ behavior for long times, the diffusivity and potential
are, respectively, assumed as the power-law forms $D(x)=D_0|x|^\alpha$ and
$U(x)=U_0|x|^\beta$ for simplicity. Based on the competition roles played by
$D(x)$ and $U(x)$, three different cases, $\beta>\alpha$, $\beta=\alpha$, and
$\beta<\alpha$, are discussed. The system is ergodic for the first case
$\beta>\alpha$, where the time average agrees with the ensemble average, being
both determined by the steady solution for long times. In contrast, the system
is non-ergodic for $\beta<\alpha$, where the relation between time average and
ensemble average is uncovered by infinite-ergodic theory. For the middle case
$\beta=\alpha$, the ergodic property, depending on the prefactors $D_0$ and
$U_0$, becomes more delicate. The probability density distribution of the time
averaged occupation time for three different cases are also evaluated from
Monte Carlo simulations.
