# Convex function with rapidly changing Hessian, or non-continuous Hessian

Can someone give some examples of convex functions with positive semi-definite Hessian, where the Hessian is non-continuous everywhere?

• I don't have a sufficiently strong command of integral theory here. But I'm pretty sure the second fundamental theorem of calculus would say no; that a function discontinuous everywhere cannot be the derivative of a continuous function---and, therefore, it can't be the second derivative of one, either. Hence it can't be the Hessian of any function, convex or otherwise. – Michael Grant Jan 21 '17 at 5:25
• Thanks for your answer. However, my understanding of the second fundamental theorem of calculus is that if f is continuous then f can be F's derivative. It does not imply directly "a function discontinuous everywhere cannot be the derivative of a continuous function". Do you have a reference for this statement? – Sisi Jan 23 '17 at 5:56
• I do not, which is why it was a comment, not an answer ;-) However I'm reasonably sure that a Riemannian integrable function can only have a countable number of discontinuities. – Michael Grant Jan 23 '17 at 12:02
• Thanks for pointing out the direction, I will look for that. – Sisi Jan 23 '17 at 18:26

$$f(x) = \mathbf 1_{x\le 0} {x^2\over 2} + \mathbf 1_{x\ge 0} x^2$$