Q:

Difference in limits because of greatest-integer function

A Problem : \begin{equation}\lim_{x\to 0} \frac{\sin x}{x}\end{equation} results in the solution : $1$
But the same function enclosed in a greatest integer function results in a $0$
\begin{equation}\lim_{x\to 0} \left\lfloor{\frac{\sin x }{x}}\right\rfloor\end{equation}
Why?
My thoughts:
[The value of the first function tends to 1 because of the expansion :
$$\frac{\sin\left( x \right)}{x}\approx\frac{  x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots}{x}$$ 
$$\approx 1 - \frac{x^2}{3!} + \frac{x^4}{5!} - \frac{x^6}{7!} + \cdots$$
and putting zero in the function results in 1
but applying the greatest integer function to the same will result in a zero as whenever the value of the result is taken it will be slightly less than one because of all the subtractions involved in the expansion.]

A:

The problem that is ocurring in your example is that the greatest integer function is not continuous. One consequence of this is that in general the limits $\lfloor \lim_{x\to c}f(x)\rfloor$ and $\lim_{x\to c}\lfloor f(x)\rfloor$ will not be equal to each other. This happens because the greatest integer function changes value abrubtly as you move along $\mathbb{R}$; every time you hit an integer, the value jumps up by $1$. So if, as $x\to c$, the function $f(x)$ approaches an integer $n$ from below, as in the case of $\frac{\sin{x}}{x}$ as $x\to 0$, the greatest integer function will (for $x$ close enough to $c$) return $n-1$, as $f(x)$ eventually exceeds $n-1$ as $x\to c$, but it never gets as high as $n$. On the other hand, if you take the limit first, you "attain" $n$, and then the greatest integer function returns $n$.
In general, $g(\lim_{x\to c}f(x))=\lim_{x\to c}(g(f(x))$ for all $c$ and $f$ such that $\lim_{x\to c}f(x)$ actually exists if and only if the function $g$ is continuous. This has several equivalent definitions, but can be thought of roughly as meaning the graph of $f$ has no sudden jumps (and doesn't oscillate too fast, like $\sin\frac{1}{x}$).
There are lots of big theorems about when you can swap the order of taking a limit and applying some other function, and when you can change the order of two limits etc. This turns up quite a lot with theorems about differentiation, integration and series, and mixtures of the three, as all are defined in terms of limits.

