Happy Thanksgiving to those of you in the States.

I have a problem:

Suppose that a function f [a,b] to R is continuous such that f attains its minimum or maximum on [a,b] at a point c such that

a<c<b.

Prove that f cannot be injective.

How would you work through this proof?