Let's say such function does exist. Since it's image is $[c,d)$, we know $f$ reaches values arbitrarily close to $d$ on the interval $[a,b]$ but never actually reaches $d$. So, let's make a sequence of values of $f$ that get closer and closer to $d$.
Let's define $x_n$ as a sequence of numbers in $[a,b]$, such that $$|f(x_n)-d| < \tfrac1{2^n}$$
Does this seem familiar? If you know about limits, this is pretty much the definition of a limit. So, we see
$$\lim f(x_n) = d = f(\lim x_n)$$ But, since all $x_n\in[a,b]$, we know $\lim x_n\in[a,b]$. So, let $X = \lim x_n$, and we see $f(X) = d$. This is a contradiction, because we assumed $f$ didn't reach $d$ on $[a,b]$.
We conclude, such function does not exist.