Certainly for continuous function, it is true. What about this? We can narrow down it to the fact that $f(0)>0$ and $f(1)<1$. For some $x\in(0,1)$, $g(x) = f(x)-x$ has the property that $g(x)$ attains negative and positive value inside a small neighbourhood of $x$.