We provide a rigorous proof that the Hartree Fock energy, as a function of the fractional electron number, E(N), is piecewise concave. Moreover, for semi-local density functionals, we show that the piecewise convexity of the E(N) curve, as stated in the literature, is not generally true for all fractions. By an analysis based on exchange-only local density approximation and careful examination of the E(N) curve, we find for some systems, there exists a very small concave region, corresponding to adding a small fraction of electrons to the integer system, while the remaining E(N) curve is convex. Several numerical examples are provided as verification. Although the E(N) curve is not convex everywhere in these systems, the previous conclusions on the consequence of the delocalization error in the commonly used density functional approximations, in particular, the underestimation of ionization potential, and the overestimation of electron affinity, and other related issues, remain unchanged. This suggests that instead of using the term convexity, a modified and more rigorous description for the delocalization error is that the E(N) curve lies below the straight line segment across the neighboring integer points for these approximate functionals.