Constant function $f : \mathbb{R}\to\mathbb{R}$ non-injective? If $f$ is a constant function such that $f(x) = c$, $x\in\Bbb R$ and $c\in\Bbb R$, does $f$ qualify as a real-valued function $f:\Bbb R\to\Bbb R$? Also, $f$ would be non injective, right?
I'm trying to prove that the following is false : If $f:\Bbb R\to\Bbb R$ is a function, real numbers $a\lt b$ such that $f$ is injective in $[a,b]$ always exist.
Would using a constant function like the one in the first paragraph as a counter-example do the trick and disprove the second paragraph?
Thanks so much in advance.
 A: Since $c\in\Bbb R$, yes, the constant function $c$ is a real-valued function. And it is non-injective.
Your question is unclear. If the question is

If $a,b\in\Bbb R$ and $a<b$, then must there be a real-valued function with domain $\Bbb R$ which is a surjective function from $\Bbb R$ onte $[a,b]$?

Then the statement is true: if you define$$\begin{array}{rccc}f\colon&\Bbb R&\longrightarrow&\Bbb R\\&x&\mapsto&(b-a)\sin(x)+\frac{a+b}2,\end{array}$$then the range of $f$ is $[a,b]$. I don't see how do you intend to use a constant function as a counter-example.
But if the question is

Does the range of every real valued function with domain $\Bbb R$ alwyas contain an interval $[a,b]$ with $a<b$?

then the answer is negative and a constant function will work as a counter-example.
And if the question is

For every function from $\Bbb R$ into $\Bbb R$, must there be $a,b\in\Bbb R$ such that $a<b$ and that $f|_{[a,b]}$ is injective?

then you're right: no, and any constant function is a counter-example.
