Suppose $f(x) \rightarrow M$ as $x \rightarrow a$. Prove that if $f(x) \leq L$ for all $x$ near $a$, then $M \leq L$. I'm am a student taking a real analysis paper at university. I'm going through some problems on my problem sheet and I've been asked the question above.
I'm still getting a hang on what it means for $x$ to be "near" $a$ but gather, that if $f(a) \leq L$ and $f(a) = M$ then $M \leq L$ is implied.
If anyone can help me understand the mathematical definition of something being "near" something else and some tips on how to carve a rigorous proof of the above. It would be much appreciated!
Thank you for your time!
 A: Let $\epsilon>0$ be a small number, e.g., $\epsilon=0.01$ (it can be any number). Then, for any such $\epsilon$, you can define an $\epsilon$-neighborhood $U_\epsilon(a)$ of $a$ by 
$$U_\epsilon(a)=\{x\in\mathbb R: d(x,a)<\epsilon\}$$
where $d(\cdot,\cdot)$ is some distance, e.g., $d(x,a)=|x-a|$ (the absolute value of their difference). Then, in this exercise, you know that $f(x)\le M$ for all $x\in U_\epsilon(a)$ and this for every $\epsilon>0$ sufficiently small, i.e., near $a$. 
Note: the exercise does not specify whether this holds for any $\epsilon<0.01$ or any $\epsilon<0.001$ and this is where you may think that the statement has some ambiguity. But actually you don't need to know the exact threshold, only that for sufficiently small $\epsilon>0$, i.e., near $a$, you have some desired property. 
A: In fact an even stronger version of this result holds. Suppose $f, g$ are real functions defined on $X \subset \mathbb{R}$, let $a \in X'$ and suppose also that:
$$\lim_{x \to a } f(x) = L < \lim_{x \to a} g(x) = M$$
Then there's a neighbourhood $(a - \delta, a + \delta)$ of $a$ in which $f < g$. Indeed, setting $\varepsilon = \frac{1}{2}(M - L) > 0$, we have $L + \varepsilon = M -\varepsilon$, and by the definition of limits there exists a $\delta > 0$ such that $x \in (a- \delta, a + \delta) \implies |f(x) -  L| < \varepsilon$ and $g(x) \in (M - \varepsilon, M + \varepsilon)$, therefore 
$$f(x) < \frac{L + M}{2} < g(x) \text{ for all }x \in (a - \delta, a + \delta)$$
An immediate corollary of this is that if $f \leq g$ everywhere and:
$$\lim_{x \to a } f(x) = L \text{ and } \lim_{x \to a} g(x) = M $$
then $L \leq M$. Your desired result is then an immediate consequence of this.
A: Given: $\lim_{x \rightarrow a} f(x)=M$, and in a $\delta$ neighbourhood of $a$, i.e. there is a $\delta >0$ s.t. 
$|x-a| \lt \delta$ implies $f(x)\le L.$
Assume $M >L$.
For $|x-a|<\delta$ we have  $f(x)\le L <M.$
Let $n_0 >1/\delta$ (Archimedean principle).
For $n\ge n_0$
$|x_n-a| <1/n \le 1/n_0 <\delta$, i.e. the $x_n$ are near enough and converge to $a$.
Then
$f(x_n) \le L <M$, and 
$M=\lim_{n \rightarrow \infty}f(x_n)\le L<M$, a contradiction.
