The first thing I would notice is that (a, b) is an open subinterval of [a,b]. So your example function must be increasing on (a, b) (and there is a very easy example of such a function). And then you would need to pick values for f(a) and f(b) so that the function on [a,b] is NOT increasing. Again, fairly easy.