# Find a function $g$ that makes $f$ continuous, but not differentiable

Consider the function $$f:[-1,1] \to \mathbb{R}$$ defined piecewise by \begin{align*}f(x) = \begin{cases}0: -1 \leq x < 0 \\ g(x): 0\leq x \leq 1 \end{cases}\end{align*} where $$g:[0,1] \to \mathbb{R}$$ is some function. Suppose $$g$$ is a non-zero function given by $$g(x) = a_0 + a_1x + a_2x^2 + a_3x^3.$$ Find non-negative real numbers $$a_0, a_1, a_2, a_3$$ (not all of which are 0) such that $$f$$ is continuous but not differentiable.

I've been able to find some examples of general continuous, but not differentiable functions, but I have not been able to find one that fits this specific example AND to supply non-negative real numbers that makes it true. My problem is I can't preserve continuity at $$f(0)$$ but make $$f(x)$$ non-differentiable given the restriction of the $$a_i$$'s.

• Do you know under what circumstances would $f$ would be continuous but not differentiable? Especially at $0$? Sep 8, 2020 at 16:37
• "I can't preserve continuity and $f(0)$ but make $f(x)$ non-differentiable" - well, it's easier to make something continuous than it is to make it differentiable. If you just think about continuity and forget about differentiability you'll probably have an example. Hint: why not try a linear function? Sep 8, 2020 at 16:40
• $f$ won't be differentiable if the limits approaching 0 (from the right and left) are not the same? For example I know that if $g(x) = |x|$, the function would be continuous but not differentiable at $f(0)$. However, I wouldn't be able to supply explicit $a_i$ values which the problem seemed to want. Sep 8, 2020 at 16:41

What about $$g(x) = x+x^2$$? $$g(0)=0$$ and $$g^\prime(0) = 1 \neq 0$$ so $$f$$ is continuous at $$0$$ but not differentiable at that point.
By the way any $$g(x) = a_0 + a_1x + a_2x^2 + a_3x^3$$ with $$a_0= 0, \ a_1 \neq 0$$ and $$a_0,a_1,a_2,a_3$$ non-negative would work.
• $g(x)=x$ is simpler
• I can see why that would not be differentiable, but how do I satisfy "finding non-negative real numbers $a_0, a_1, a_2, a_3$" part? Sep 8, 2020 at 16:43
• $0, 1, 1, 0$ are all non-negative. Sep 8, 2020 at 16:48
• @Miguel Whatever $g(x) = a_0 + a_1x + a_2x^2 + a_3x^3$ with $a_0= 0, \ a_1 \neq 0$ would work. The one I picked up is my preferred one as I like the prime number $2$ . Sep 8, 2020 at 16:56