Using static electronic structure calculations, we determine the equation of state, the full elastic constant tensor and the sound wave velocities of cementite (Fe3C) at pressures up to 410 GPa. Fe3C is ferromagnetic (fm) at ambient pressures. Upon compression, the magnetic moment of the Fe atoms are gradually lost and, at around similar to 62 GPa, Fe3C becomes non-magnetic (nm). We find that the pressure-volume results for the Fe3C (fm) phase are well represented by a Vinet equation of state with K-0(fm) = 183 GPa, K-0 = 5.9, and V-0(fm) = 151.6 angstrom(3) and that of the Fe3C (nm) phase are well represented by a Vinet equation of state with K-0(nm) = 297 GPa, K'(0) = 4.9, and V-0(nm) = 143.2 angstrom(3). A third-order Birch-Murnaghan equation of state formulation for the Fe3C (nm) phase yields similar parameters with K-0(nm) = 304 GPa, K-0 = 4.5, and V-0(nm) = 143.3 angstrom(3). At pressures relevant to the Earth's inner core, the full elastic constant tensor of Fe3C (nm) reveals significant P-wave anisotropy (similar to 10%). A crystal preferred orientation with the [110] directions of Fe3C aligned along the pole axis would be required to explain the inner core anisotropy. Comparing, pure hcp Fe and iron carbides with varying stoichiometry, we find that the shear wave velocity decreases linearly with the increasing C content.