Proving inequalities about integral approximation We can state that, with $n$ integer,
$$\int_1^n \log x \ \mathrm{dx} \leq \sum_{m = 1}^n \log m$$
because the second is the area of $n$ rectangles with unity base, while the first is "just" the area under the function. 
1) How can it analitically or geometrically be proved? 
2) Can this be stated in any other case? Supposing that $f(x)$ is integrable, is it always true that
$$\int_1^n f(x) \ \mathrm{dx} \leq \sum_{m = 1}^n f(m)$$
?
Or what are the conditions under which that is true?
 A: $$\large \underline{\texttt{Analytic Proof}}$$
Observe that $\log{x}$ is increasing.$(1)$
Observe that
$$\int\limits_{1}^{n}{\log x\, dx}=\int\limits_{1}^{2}{\log x \, dx}+\int\limits_{2}^{3}{\log x\, dx}+\cdots +\int\limits_{n-1}^{n}{\log x\, dx} \tag{2}$$
For an integrable function $f$, if $f(x)\le M \quad \forall x\in [a,b]$ then $$\int\limits_{a}^{b}{f(x) dx} \le M(b-a) \tag 3$$
Observe with the help of $(1)$ and $(3)$ that
$$\int\limits_{m-1}^{m}{\log x\, dx}\le \log{m} \tag{4}$$
Using $(2)$ and $(4)$ see that
$$\int\limits_{1}^{n}{\log x\, dx}\le \log 2+\log 3 +\cdots +\log n=\sum\limits_{m=1}^{n}\log m $$

$$\large \underline{\texttt{Geometric Proof}}$$
Recall that $\int\limits_{a}^{b}{f(x)}$ is defined as the area under the curve $f(x)$, now have a look at the graph below.

Compare the area between $\log x$ and $x$ axis with the area of green region and $x$ axis to get a result. $(1)$ plays a role in our assumption about areas.
You can also see here for a graph.

$$\large \underline{\texttt{Conditions}}$$
If $f(x)$ is $\color{blue}{\text{increasing}}$ then the following is true
$$\int\limits_1^n f(x) \ \mathrm{dx} \leq \sum\limits_{m = \color{red}{2}}^n f(m)$$
(The proof of this result is similar to the analytic proof we have done.)
Note: 


*

*$\log 1=0$, so that we can replace $\sum\limits_{m = \color{red}{2}}^n \log m$ by $\sum\limits_{m = \color{red}{1}}^n \log m$

*If $f(1)>0$ clearly $\int\limits_1^n f(x) \ \mathrm{dx} \leq \sum\limits_{m = \color{red}{2}}^n f(m) \le \sum\limits_{m = \color{red}{1}}^n f(m)$

*You might be interested in the reading about integral test.

A: *

*$$\int_1^n \log(x) dx=[x\log(x)-x]_1^n=n\log(n)-n+1\lt \sum_{m=1}^n \log(m)=\log(\prod_{m=1}^n m)=\log(n!)\approx n\log(n)-n + O(\log(n)),$$ where I used Stirling's approximation. The next term in the $O(\log(n))$ is $(1/2)\log(2\pi n)>1$, for $n>1$.

*No, assume $f(x)=-\log(x)$...

