suppose it has IVP, if it takes some value an infinite number of times, let that value be d, then f^{-1}(d) is infinite, since it is infinite it has accumulation point, say c, so there is a sequence c_n, converging to c such that f(c_n)=f(c) for every n, and also, for every m,n in N it is true that f(c_m)=f(c_n),
but then for every m,n in N the function takes on all values between f(c_m)=d and f(c_n)=d, so it is constant between those points, so the constant is the only continuous function that has IVP and takes some value more than finitely many times?