sorry if this is a very obvious question, but I'm writing a proof for the Kulback-Leibler inequality and the first step is to state $\log(x) \leq x-1$ for all $x>0$.
I get it for $x>1$, but in my notes this isn't stated and when I looked on this site for answers all I could see were proofs showing this was the case for all $x>0$.
As far as I'm aware this demonstrably isn't the case for $0<x<1$ so I'm wondering what I'm missing here.
One way is to use calculus.
Define a function $g$ on $(0,\infty)$ by $g(x)= log\ x-x+1$. Now you check that this function attains the local maximum at $x=1$. Therefore $g(x) \leq g(1)$ for every $x \in (0,\infty)$. Hence $\log x \leq x-1$ for all $x \in(0,\infty)$.