Let us suppose you have a certain function $f(x)$ and you want to find out in which intervals this function is decreasing, constant or increasing. I know you need to follow these steps:

Find out $f'(x)$.

Find out the values for which $f'(x)=0$. In other words, we need to find out the zeroes of $f'(x)$. Let's suppose we find out two values which are $x=a$ and $x=b$, and that $a<b$.

Now we need to choose a random value $r$ from the interval $(-\infty,a]$ or $(-\infty,a)$ (I don't remember exactly) and calculate $f'(x)$ for $x=r$.

If $f'(x)<0$ for $x=r$, then $f(x)$ is decreasing in the mentioned interval. If $f'(x)=0$ for $x=r$, then $f(x)$ is constant in that interval. If $f'(x)>0$ for $x=r$, then $f(x)$ is increasing in that interval.

We need to repeat steps 3 and 4 for the other intervals.

Now, what happens if $f'(x)$ doesn't have any zeroes? What should I do?

Example of a (derivative) function that doesn't have any zeroes: $e^x/x$.

3 Answers
3

For the types of functions that you are probably dealing with, you can simply expand your step 2 to examine points where $f'(x)=0$ or $f'(x)$ is undefined. If this set has only isolated points, then these are the only points where the derivative can change sign. In the example that you give, we have
$$f'(x) = \frac{e^x }{x}$$
which is undefined at zero. Thus, it is possible for the derivative to change sign there as well and, in fact, it does. Thus the correct answer is that the function is decreasing on $(-\infty,0)$ and then increasing on $(0,\infty)$. Here's a plot of one possible anti-derivative for this function:

Of possible interest is the fact that the non-differentiability at the origin means that the two "branches" could be shifted different amounts. Thus, another possible anti-derivative is

There is one other point that has been glossed over by all the answers - namely derivatives, while not necessarily continuous, do satisfy the intermediate value property. Thus, if a derivative is defined and non-vanishing on an interval then it cannot change signs on the interval.

In case we didn't have more separation points --assuming that the given function is continuous (and differentiable) everywhere-- (e.g. for $f(x)=e^x$), we would have only one interval, $(-\infty,+\infty)$, and, as $e^0=1>0$, we could conclude that $f$ is increasing/decreasing throughout $\Bbb R$.