Find out the local maxima/minima of $x^3$ in $[0,1]$?
$$f'(x)=3x^2$$
At $x=0$ we have $f'(x)=0$. But as we know that $x=0$ is the point of inflection.
On the other hand $x<0$ is not in the domain, so in the given interval $[0,1]$, $x=0$ satisfies the condition of minima.
So what is the correct way to go in such cases?
In this fairly simple case, you don't need to actually use derivatives. Instead, note $f(x) = x^3$ is a strictly increasing function for $x \ge 0$ (which you can also see since $f'(x) = 3x^2 \gt 0$ for $x \gt 0$, or that if $y \gt x \ge 0$, then $f(y) - f(x) = y^3 - x^3 = (y - x)(y^2 + yx + x^2) \gt 0$). Thus, for $x \in [0,1]$, the local minimum would be $f(0) = 0$ and the local maximum would be $f(1) = 1$.