# Piecewise convexity and global convexity

Let $$f:\mathbb{R}\rightarrow\mathbb{R}$$ be continuous on $$\left[0,1\right]$$. Consider $$z\in\left(0,1\right)$$ and suppose that $$f$$ is differentiable and convex on $$\left[0,z\right]$$ and $$\left[z,1\right]$$. If $$f'$$ (i.e., $$\frac{df}{dx}$$) is continuous at $$z$$, then $$f$$ is convex on $$\left[0,1\right]$$. - Is this proposition true? While I could not create a counter-example, I am finding it difficult to generate a clean proof as well.

• OK, I got your answers, and thank all of you for that. However, I would like to add something more to this question. To what extent, can I relax continuity of $f'$, and still have global convexity? Following your lines of proof, it seems to me that as long as the left-side derivative ($f'_{-}$) at $z$, which is well defined, is less than the right-side derivative ($f'_{+}$) at $z$, which is well defined as well, global convexity prevails. I do not need continuity of $f'$ precisely - Is this correct? – Tapas Aug 14 at 15:26

A differentiable function $$f$$ is convex on an interval $$(a,b)$$ if and only if its derivative $$f'$$ is increasing.
Therefore, your assumptions imply that $$f'$$ is increasing on $$(0,z)$$ and on $$(z,1)$$. Now your assumption that $$f'$$ is continuous immediately gives you that $$f'$$ is increasing on $$(0,1)$$ and therefore convex.
• Thanks for your answer. If I relax continuity of $f'$ at $z$, and just assume that the left-side derivative of $f$ at $z$ is less than the right-side derivative of $f$ at $z$, global convexity will still hold - is it right? In fact, I was wondering that is an "if and only if" condition to maintain global convexity. – Tapas Aug 14 at 15:42
• Yes, you are right it generalizes in the way you suggest it. But note that this does not follow from the proof I gave because the criterion I used needs that $f$ is differentiable in the whole interval. If you weaken this assumption you will have to proof it in a different way. I think it will boil down to using the definition of convexity and show it explicitly like one would show the theorem I used in my answer. – Stefan Egger Aug 14 at 16:16
A differentiable function is convex in an interval $$I$$ if and only if $$f'$$ is increasing in $$I$$. Now we have that $$f'(x)\leq f'(z)\leq f'(y)$$ for any $$0\leq x. Can you take it from here and show that the proposition is true?
Yes it's true. $$f$$ is convex iff $$f'$$ is monotonically non-decreasing, but it works on $$[0, z)$$ and $$(z, 1]$$. But $$f'$$ is continuous at $$z$$ so it can't be less than 0 otherwise there would be a neighborhood where it is negative and thus not convex.