Limit of a Piecewise Function defined on Rationals and Irrationals
HINT: Just use the $\epsilon$-$\delta$ definition of limit. Given $\epsilon>0$, you know that there are $\delta_g>0$ and $\delta_h>0$ such that $|g(x)-L|<\epsilon$ whenever $0<|x-c|<\delta_g$ and $|h(x)-L|<\epsilon$ whenever $0<|x-c|<\delta_h$. Let $\delta=\min\{\delta_g,\delta_h\}$; what can you say about $|f(x)-L|$ when $0<|x-c|<\delta$?