Let $f(x) = x^2$ if $x\in \mathbb{Q}$ and $f(x)=0$ if $ x\in \mathbb{R}-\mathbb{Q}$ Let $f(x) =
\begin{cases}
x^2,  & x\in \mathbb{Q} \\[2ex]
0, & x\in \mathbb{R}-\mathbb{Q}
\end{cases}$ and  $g(x)=\lfloor x \rfloor +\lfloor -x \rfloor$
then find the limits :
$$\lim_{x \to 0} f(g(x))=?$$

i know that 
$$g(x) =
\begin{cases}
-1,  & x \notin \mathbb{Z} \\[2ex]
0, & x\in \mathbb{Z}
\end{cases}$$
Now what do I do ? 
 A: For any $x$ with $|x|<1$ you have correctly identified that $g(x)=-1$. Hence for all such $x$ we have $f(g(x))=f(-1)=1$ (as $-1$ is rational). From this it is possible to prove via the definition of a limit that $\lim_{x\to 0}f\circ g(x)=1$.
A: It is obvious that $g(x)$ is always an integer, so that the "$x^2$" case of the definition of $f$ applies. And by closer observation, $f(g(x))=1$ around $0$. This is the requested limit.

Note that to compute the limit, the value of the function at $x=0$ does not matter at all.
A: For $\lim_{x\to 0} WhatEverTheEff$ we may assume $-1 < x < 1$ and $x\ne 0$.
So if $x < 0$ then $g(x) = -1 + 0 = -1$ and $g(x) = 0 + -1 = -1$ if $x > 0$. 
As $g(x) \in \mathbb Q$, $f(g(x)) = (g(x))^2 = 1^2 = 1$.
So $\lim_{x\to 0} f(g(x))= \lim_{x\to 0} 1 = 1$.
....
If you want to be formal.
For any $\epsilon > 0$ let $\delta = 1$.  If $0< |x-0| < \delta$ then $f(g(x)) = 1$ and so $|f(g(x)) - 1| = 0 < \epsilon$.
A: Hint: $g(x)=\lfloor x\rfloor+\lfloor-x\rfloor\in\mathbb{Z}\subset\mathbb{Q}$. In fact $g(x)=-1$ if $x\not\in\mathbb{Z}$ and $g(x)=0$ if $x\in\mathbb{Z}$.
Therefore, if $x\not\in\mathbb{Z}$,
$$
f(g(x))=g(x)^2=1
$$
