We report on the most complete investigation to date of the 4f-electron properties at the gamma-alpha transition in elemental Ce by resonant inelastic x-ray scattering (RIXS). The Ce 2p3d-RIXS spectra were measured directly in the bulk material as a function of pressure through the transition. The spectra were simulated within the Anderson impurity model. The occupation number nf was derived from the calculations in both gamma- and alpha-phases in the ground state along with the f doubleoccupancy. We find that the electronic structure changes result mainly from band formation of 4f electrons which concurs with reduced electron correlation and increased Kondo screening at high pressure.