How to show where a funcion is differetiable? I mean what is the basic technique on functions which are defined like 
$h(x)$= {$f(x)$ if $x$$\in$$[a,b]$ and $g(x)$ if $x$$\in$$[c,d]$}.
An example:$f(x)$={$x$*$cos({1\over x})$ if $x$ is not $0$ and $0$ if $x=0$}.
 A: In your example (and in most examples of this type), it is easy to see that $f|_{\mathbb{R} \setminus \{0\}}$ is differentiable (chain rule, ...). This means that $f$ is differentiable at $x$ for every $x \in \mathbb{R} \setminus \{0\}$. For this conclusion it is essential that $\mathbb{R} \setminus \{0\}$ is an open set.
For the remaining point $x=0$ you use the definition of differentiability, i.e. you write down the difference quotient
$$ \frac{f(x_0 + h) - f(x_0)}{h},$$
where in your example $x_0 = 0$ and determine whether the limit $h\rightarrow 0$ of this quotient exists.
In many examples it is useful to consider the cases $h \downarrow 0$ and $h \uparrow 0$ seperately.
Pro tip: If you know that $f|_{[c,d]} = g|_{[c,d]}$ for some differentiable function $g : \mathbb{R} \rightarrow \mathbb{R}$ (actually, $g : U \rightarrow \mathbb{R}$ with $c$ in the interior of $U$ suffices), then you know
$$\lim_{h \downarrow 0} \frac{f(c + h) - f(c)}{h} = \lim_{h \downarrow 0} \frac{g(c + h) - g(c)}{h} = g'(c).$$
An analogous calculation can be made for $h \uparrow 0$ if $f|_{[a,c]} = u|_{[a,c]}$ for some differentiable function $u$ similar to $g$ above. Here we assumed $a < c < d$.
The function $f$ is thus differentiable in $c$ iff $u'(c) = g'(c)$.
