Taking limits on each term in inequality invalid?
Its a pretty standard theorem which was originally called "Sandwich Theorem" but nowadays more popularly known as "Squeeze Theorem".
Squeeze Theorem: If $\{a_{n}\}, \{b_{n}\}, \{c_{n}\}$ are sequences such that $a_{n} \leq b_{n} \leq c_{n}$ for all $n$ greater than some specific positive integer $N$ and $\lim_{n \to \infty}a_{n} = \lim_{n \to \infty}c_{n} = L$ then the sequence $b_{n}$ also converges to $L$. The conclusion is same even if one or both of the inequalities in $a_{n} \leq b_{n} \leq c_{n}$ are replaced by their strict versions.
In the current question $a_{n} = c - (1/n), b_{n} = f(x_{n}), c_{n} = c$ so that $c_{n}$ is a constant sequence. Clearly both the sequences $a_{n}, c_{n}$ converge to $c$ and hence $b_{n} = f(x_{n})$ also converges to $c$.
The proof of the Squeeze theorem is particularly easy. Since both the sequences $a_{n}, c_{n}$ tend to $L$ as $n \to \infty$ it is possible to find a positive integer $m > N$ corresponding to any given $\epsilon > 0$ such that $$L - \epsilon < a_{n} < L + \epsilon,\, L - \epsilon < c_{n} < L + \epsilon$$ for all $n \geq m$. Since the value $m$ is chosen to be greater than $N$, the inequalities between $a_{n}, b_{n}, c_{n}$ hold for $n \geq m$ and hence we have $$L - \epsilon < a_{n} \leq b_{n} \leq c_{n} < L + \epsilon$$ for all $n \geq m$. And this means that $$L - \epsilon < b_{n} < L + \epsilon$$ for all $n \geq m$ (you can clearly see that this conclusion remains same even if we had strict inequalities between the given sequences). Therefore $b_{n} \to L$ as $n \to \infty$.
Your problem (or confusion) is also related to the application of limit operation on inequalities.
If we have sequences $a_{n}, b_{n}$ with $a_{n} < b_{n}$ and both the sequences converge to $a, b$ respectively then from this information we can only conclude that $a \leq b$.
Since $a \leq b$ includes both the cases $a = b$ and $a < b$, both the options are possible in actual examples. For example take $a_{n} = 1 - (1/n), b_{n} = 1 + (1/n)$ then we have $a_{n} < b_{n}$ and both sequences tends to $1$. On the other hand if $a_{n} = 1/n$ and $b_{n} = 1 + (1/n)$ then we have the case $a = 0, b = 1$ so that $a < b$. Normally we need more information to find whether $a < b$ or $a = b$.
Here's what the author is using: Suppose $\{x_n\}$ and $\{y_n\}$ are sequences that converge to $x$ and $y$ respectively and for all $n$, $x_n \leq y_n$. Then $x \leq y$.
The way we get around the example in your question is to avoid the strict inequality. Things do go awry when use $<$. However, with $\leq$, things do not.
A proof of the statement, for any non-believers: it suffices to show that this is true when $x_n = 0$ for all $n$. (Just subtract the $x_n$ over if this is not the case). Suppose that $y < 0$. Then there is some sufficiently large $N$ so that if $n > N$, $|y_n -y| < -y/2$. Let $n>N$. But this would imply that $y/2< y_n - y < -y/2$. Furthermore, it would imply that $$ y_n < y - \frac{y}{2} = \frac{y}{2} < 0. $$ But we assumed that $0 \leq y_n$ for all $n$, so our assumption that $y < 0 $ must be false, and in fact $0 \leq y$.
This is an application of a basic theorem called squeeze theorem: $\def\nn{\mathbb{N}}$
Given any sequences $(a_n)_{n\in\nn}$ and $(b_n)_{n\in\nn}$ and $(c_n)_{n\in\nn}$ such that $a_n \le b_n \le c_n$ for any $n\in\nn$:
If $\lim_{n\to\infty} a_n = \lim_{n\to\infty} c_n = x$ for some $x$:
$\lim_{n\to\infty} b_n = x$.
Incidentally, the usual proof of the squeeze theorem (which others have already given) essentially proves a more general theorem:
Given any sequences $(a_n)_{n\in\nn}$ and $(b_n)_{n\in\nn}$ such that $a_n \le b_n$ for any $n\in\nn$:
$\limsup_{n\to\infty} a_n \le \liminf_{n\to\infty} b_n$.
This theorem is very useful because it implies the following powerful technique in proving limits:
Given any sequences $(a_n)_{n\in\nn}$ and sequences $(b_{m,n})_{m,n\in\nn}$:
If for any $m \in \nn$ we have $| a_n - b_{m,n} | \le \frac{1}{m}$ for any $n\in\nn$:
$\lim_{n\to\infty} a_n = \lim_{n\to\infty} b_{n,n}$.