Why can't $f(a) = f(b)$ in the intermediate value theorem. In calculus class the intermediate value theorem was introduced as follows:

If $f(x)$ is continuous on the interval $[a,b]$
If $f(a) \not = f(b)$
If $k \in [f(a),f(b)]$
Then $\exists c \in [a,b], f(c) = k $

However, I do not see why it is necessary that the second condition hold, because it is true that if $k\in[f(a),f(a)]$ then there exist such a $c$, namely $a$.
(Note that this theorem was stated for the reals only, but I am comfortable with general metric spaces, if that helps..)

You ask if it is true that given continuous $f:[a,b]\to\mathbb{R}$ and $k$ lying between $f(a)$ and $f(b)$, but not strictly between, then we can find $c\in[a,b]$ such that $f(c)=k$.
Yes, it is true. If $f(a)=f(b)$, then $k$ must be $f(a)$, because that is the only value lying between $f(a)$ and $f(b)$, and hence we can take $c=a$. If $f(a)\ne f(b)$, then we can use the IVT. 
Why is the IVT not usually stated that way? Well it is usually stated that we can find $c\in(a,b)$, rather than $c\in[a,b]$, so it would become false if we did not require strict inequalities as shown by Silynn. But you could state it the way you suggest. However, once one way has got well established it is usually confusing to start using a subtly different way.
