Is it possible for an elementary continuous and non-piecewise function to be linear on some part of the interval and nonlinear on another part of the interval?
For instance; a function has second derivative zero on [1,4] and after x = 4, it starts to curve. Also note that piecewiseness and infinitely many terms are not allowed.
Miguel provided a good answer with the absolute value trick. But if you want to only use nice, smooth (elementary) functions which are differentiable everywhere, the answer is no.
All of the elementary functions are analytic (a term which I will define later), and the composition/sum/product/etc. of analytic functions is analytic, so any nice function that you come up with is analytic.
Now "analytic" means that if you give a point $p$ somewhere in their domain, you can give a power series $\sum a_k (x-p)^k$ that converges to your function in a small interval around $p$. Now let $p$ be the point where your function goes from being linear to being non-linear, and try to find the power series expansion around $p$. On one side, it has to be $a_0+a_1(x-p)+0+0(x-p)^2+0(x-p)^3+ \cdots$, but on the other side it has to be something else. This is impossible.