Example of a function which is not differentiable on parts of its domain Can you provide me with an example of a function $f:\mathbb{R} \to \mathbb{R}$ which is not piece-wise defined and differentiable on some parts of its domain and some parts not?
I am curious to know whether it is possible to say soemthing like this: "function f is differentiable until point x=5 but for values x>5  it is no longer differentiable". 
(I know that you can achieve this with functions like $f(x)= x^{q \over p}, p,q \in \mathbb{N}$ at point $0$ but that is not what I am looking for.)
Any ideas are welcome!
 A: I was trying to conjure up an example, but realized that i was just rewriting "piecewise defined" functions in a "not-piecewise" way. Here is an example: Consider a differentiable function $f$ and a continous but nowhere differentiable function $g$ (for example https://en.wikipedia.org/wiki/Weierstrass_function). Then the function $h(x):= max(f(x),g(x))$ is differentiable on the open set $\{x| f(x)>g(x)\}$ and not differentiable on the open set $\{x|f(x)<g(x)\}$.
But the question is now, do you consider $max(f,g)$ to be piecewise or not? Clearly it can be defined piecewise, but could also be defined by the formula
$$max(f(x),g(x)) = \frac{f(x)+g(x)}{2} + \frac{|f(x)-g(x)|}{2} $$
A: What about
$$f(x) =
\begin{cases}
0 & x \le 5\\
1 & x \in \mathbb Q \text{ and } x > 5\\
0 & x \notin \mathbb Q \text{ and } x > 5
\end{cases}$$
It is differentibale for $x \le 5$ and not even continuous for $x > 5$.
Another one... consider the map $f$ defined in this post for $x > 0$ and $f(x) = 0$ for $x \le 0$. it is continuous and never differentiable for $x > 0$ but differentiable for $x \le 0$.
Note: however those may be seen as piecewise defined.
