# Question on continuous function.

Gold Member
let f(x) be continuous for 0<=f(x)<=1. suppose that f(x) assumes rational vlaues only and that f(x)=1/2 when x=1/2. prove that f(x)=1/2 everywhere.

im having trouble with this simple question, here's what i did:
|x-1/2|<d implies |f(x)-1/2|<e. f(x) assumes only rational values so
( im guessing that by 'assumes' it's input is rational values, so
|x-x0|<d |f(x)-f(x0)|<e f(x0)=p/q
if p/q>1/2 then |f(x)-p/q|<|f(x)-1/2|<=e
and if p/q<1/2 |f(x)-1/2|<|f(x)-p/q|<e, and thus the limit of f(x) at x0 always converges to 1/2.
is this right?

## Answers and Replies

If you know a little topology, consider the following:
If $f:X\to Y$ is continuous and X is a connected set, then f(X) is also connected.

You have $f:[0,1]\to\mathbb{Q}$. What are the connected sets in $\mathbb{Q}$?

Hurkyl
Staff Emeritus
Science Advisor
Gold Member
What about the intermediate value theorem?

VietDao29
Homework Helper
loop quantum gravity said:
( im guessing that by 'assumes' it's input is rational values...
No, it's output is rational, not input.
Say if there exists some $$x_0 \neq \frac{1}{2}$$, such that: $$f(x_0) \neq f \left( \frac{1}{2} \right) = \frac{1}{2}$$, then is there any value x1 in the interval $$\left] \min \left(x_0, \frac{1}{2} \right) , \ \max \left( x_0 , \frac{1}{2} \right) \right[$$, such that f(x1) is irrational?

Gold Member
Hurkyl said:
What about the intermediate value theorem?
i also thout about it.
but it states:"If f is continuous on a closed interval [a,b] , and c is any number between f(a) and f(b) inclusive, then there is at least one number x in the closed interval such that f(x)=c." (mathworld)
it doesnt say that for every x f(x)=c (in this case c=1/2).
what it does states (from the problem) is that for every x f(x)'s output ( as viet dao corrected me, i didnt understand what assumes means here) is rational values, but how do i use the intermediate theorem here to prove that for every x f(x)=1/2.
i know that for every x f(x)=p/q, and by the theorem there's at least one x (x=1/2) such that f(x)=1/2 f(0)<=f(1/2)<=f(1), then how do i infer that for every x in [0,1] f(x)=1/2?

HallsofIvy
Science Advisor
Homework Helper
Oh, come on!!! Use proof by contradiction. Suppose f(x) is not 1/2 for all x. Then there exist at least two distinct values of f: y1 and y2. Now what does the intermediate value theorem tell you?

Gold Member
it tells us that there's at least one t such that f(t)=y1 and at least one t' such that f(t')=y2 where they are between f(a) and f(b), but i dont see how does this contradict the assumption that they are distinct?

Gold Member
wait a minute i just reread the theorem, y1 is any number between f(a) and f(b) and so is y2, so they could also be equal.

thanks halls.

VietDao29
Homework Helper
loop quantum gravity said:
wait a minute i just reread the theorem, y1 is any number between f(a) and f(b) and so is y2, so they could also be equal.

thanks halls.
No, what's a, and b? You haven't even defined them!!!
You still seem not to understand the theorem correctly. Roughly speaking, the theorem is that if the function f is continuous, and returns 2 different values y1, and y2, then it can return any value between y1 and y2.
Say if g(x) = sin(x), g(x) is continuous, right? g(0) = 0, and $$g \left( \frac{\pi}{2} \right) = 1$$, then there exists some x value between 0 and $$\frac{\pi}{2}$$, such that $$g(x) = \frac{\sqrt{3}}{2}$$, ($$\frac{\sqrt{3}}{2}$$ is between g(0), and $$g \left( \frac{\pi}{2} \right)$$). That value is $$x = \frac{\pi}{3}$$.
Can you get this?
Now read the theorem, and all the posts above to see if you can finish the problem. :)

Last edited:
Gold Member
let me know if this is any good.

suppose f(x) is not 1/2 everywhere (so only once f(x) gets the value 1/2), then there are y1,y2 which are values of f(x) which arent equal to eachother.
because f is conitnuous on an interval [0,1] there's a value 1/2 between f(x1) and f(x2) (f(x1) and f(x2) are rationals), when x1<x2<1/2 and thus there's at least one x such that f(x)=1/2 where x!=1/2.

i dont think this proof is correct cause i haven't shown why 1/2 must be between f(x1) and f(x2), i know that they are rationals but it doesnt say that those are rationals between 0 and 1, the values of the domain are between 0 and 1.

VietDao29
Homework Helper
loop quantum gravity said:
suppose f(x) is not 1/2 everywhere
This is fine. :)
(so only once f(x) gets the value 1/2)
It can get the value 1 / 2 twice, or three times, or blah blah blah, whatever. You just need to assume that there's one x0, such that: $$f(x_0) \neq \frac{1}{2}$$. Can you get this? :)
, then there are y1,y2 which are values of f(x) which arent equal to eachother.
because f is conitnuous on an interval [0,1] there's a value 1/2 between f(x1) and f(x2) (f(x1) and f(x2) are rationals), when x1<x2<1/2 and thus there's at least one x such that f(x)=1/2 where x!=1/2.
No, this part is not good. What are your x1, and x2? You haven't defined them.
Ok, so we have that:
$$f(x_0) \neq \frac{1}{2}$$, and
$$f \left( \frac{1}{2} \right) = \frac{1}{2}$$, right?
Now, is there any irrational number between the 2 distinct rational numbers f(x0), and f(1/2)? There is, right? Do you remember this thread (I almost gave up on finding this thread, I thought it was in Calculus & Beyond! ). Let call that rational number a. Ok?
According to the Intermediate Value theorem, is there any x1 between x0, and 1 / 2, such that f(x1) = a?
Now, can you go from here? Can you follow me? :)

Last edited:
HallsofIvy
Science Advisor
Homework Helper
loop quantum gravity said:
let me know if this is any good.

suppose f(x) is not 1/2 everywhere (so only once f(x) gets the value 1/2), then there are y1,y2 which are values of f(x) which arent equal to eachother.
because f is conitnuous on an interval [0,1] there's a value 1/2 between f(x1) and f(x2) (f(x1) and f(x2) are rationals), when x1<x2<1/2 and thus there's at least one x such that f(x)=1/2 where x!=1/2.

i dont think this proof is correct cause i haven't shown why 1/2 must be between f(x1) and f(x2), i know that they are rationals but it doesnt say that those are rationals between 0 and 1, the values of the domain are between 0 and 1.
You are completely misunderstanding the "intermediate value property"!
loop quantum gravity said:
it tells us that there's at least one t such that f(t)=y1 and at least one t' such that f(t')=y2 where they are between f(a) and f(b), but i dont see how does this contradict the assumption that they are distinct?
No, it doesn't say anything like that! (especially since you haven't said what y1 and y2 are.) The intermediate value property says that if y is any value between f(a) and f(b), then there exist x between a and b such that f(x)= y. That is, f takes on all values between f(a) and f(b).

You are told that f(1/2)= 1/2. If f(x) is not identically 1/2, then there exist some x1 such that y1= f(x1) is not 1/2. By the intermediate value property, if y is any value between 1/2 and y1, there exist x such that f(x)= y. Now, can you think of a value between 1/2 and y1 that will give a contradiction?

Gold Member
i think i can follow, bacuase by the intermediate theorem, f assumes any value between 1/2 and f(x0) and thus also assumes an irrational number, but by the definition of the problem it only assumes rational numbers.

thanks for the help.

iv'e got another couple of questions:
1)prove that if f(x) is monotonic in [a,b] and satisfies the intermediate value property , then f(x) is continuous.
what i did is as follows:
assume f is monotonic increasing, x>y f(x)>f(y), and that between f(y) and f(x) the function recieves the value e which correspond to the value x0 between y and x, i.e f(x0)=e, let's assume |x-y|<d, then f(x)>e>f(y)
e-f(x)>f(y)-f(x) i.e |f(x)-f(y)|<e-f(x)<e and thus the function is uniform continuous and thus also point conitinouos. is this right?

2)let f(x) be a polynomial f(x)=anx^n+...+a1x+a0
show that if n is odd, then f(x) has at least one real root, if an and a0 have opposite signs, then f(x) has at least one posirive root, and if n is even different than 0, then f(x) has a negative root as well.

for the first part here's what i did:
$$a_{2m-1}x^{2m-1}+...+a1x+a0=0$$
if we multiply by $$x=/=0$$ then $$a_{2m-1}x^{2m}+...+a_{1}x^2+a0x=0$$
if i substract both of the equations i get, $$a_{2m-1}x^{2m}+(a_{2m-2}-a_{2m-1})x^{2m-1}+...+(a_{1}-a_{2})x^2+(a_{0}-a_{1})x-a0=0$$ this equation is equivalent to the other equations (cause it's addition of one multiple of equations to another.
and this set of equations has a solution for x=1 and thus also the first equation has at least one real solution.

im not sure at all if this is correct.
i appreciate your help.

btw, im quite sure that if in the first question f satisfies the intermediate property then it's already assumed to be conitnuous in the interval, so perhaps this part of the property isnt assumed here.

Last edited:
Office_Shredder
Staff Emeritus
Science Advisor
Gold Member
loop quantum gravity said:
assume f is monotonic increasing, x>y f(x)>f(y), and that between f(y) and f(x) the function recieves the value e which correspond to the value x0 between y and x, i.e f(x0)=e, let's assume |x-y|<d, then f(x)>e>f(y)
e-f(x)>f(y)-f(x) i.e |f(x)-f(y)|<e-f(x)<e and thus the function is uniform continuous and thus also point conitinouos. is this right?

e-f(x) < 0, so how can it be greater than the absolute value of something?

I don't really follow your logic here (ignoring the absolute value error), or see where you're trying to go.... why can't the function be discontinuous at some point a > y, or < x? Or somewhere between x and e?

I would try arguing by contradiction.... if the function WASN'T continuous at a point, what does that mean about the points around it?

Last edited:
StatusX
Homework Helper
loop quantum gravity said:
for the first part here's what i did:
$$a_{2m-1}x^{2m-1}+...+a1x+a0=0$$
if we multiply by $$x=/=0$$ then $$a_{2m-1}x^{2m}+...+a_{1}x^2+a0x=0$$
if i substract both of the equations i get, $$a_{2m-1}x^{2m}+(a_{2m-2}-a_{2m-1})x^{2m-1}+...+(a_{1}-a_{2})x^2+(a_{0}-a_{1})x-a0=0$$ this equation is equivalent to the other equations (cause it's addition of one multiple of equations to another.
and this set of equations has a solution for x=1 and thus also the first equation has at least one real solution.

In effect, you've just multiplied the polynomial by (x-1), and claimed it must have a real root because this new polynomial has the real root 1. Try to see exactly where your argument breaks down.

One way to do this question is, once again, using the intermediate value theorem. A polynomial is dominated at large x by the largest power of x, and in the case of an odd degree polynomial, this term will have different signs depending on the sign of x (for example -x^3+3x+4 is negative for large positive x and positive for large negative x). Can you figure out what to do from here?

Alternatively, you could use the property that all complex roots of a polynomial with real coefficients come in complex conjugate pairs, so when there are an odd number of roots, there is at least one root which has to be its own complex conjugate (although this argument needs to be made more formal)

Last edited:
Gold Member
if the function wasnt conitnuous then there exists e>0 and d>0 such that |x-x0|<d |f(x)-f(x0)|>=e it is monotone, then suppose it's monotonic increasing then for x>y f(x)>f(y), by the intermediate property, any value value between f(x) and f(y), say c, such that x0 between x and y, and f(x0)=c f(x)>f(x0)>f(y) f(x)-f(x0)>=e, if we let e=f(x)-f(y) then f(x)-f(x0)>=f(x)-f(y) which is not possible.

i dont think this proof is correct cause in the first place i mentioned there exists an e>0, so it could be of any postive value not necessarily the value ive given.

Gold Member
when i think about again, perhaps i do have something, as before we assume that f isnt continuous then |f(x)-f(x0)|>=e for |x-x0|<d with the intermediate value property we have that for every x'>x0 in the interval [a,b] and any number c between f(x')>f(x0) tere exists x1 which is between x0 and x' such that f(x1)=c.
if we employ this property over again with x1 and x0 and then getting x2 etc, we are getting closer and closer to x0, and thus the difference between the functions at x0 and xi i=1,...,n approaches zero, which is contradiction to f not being continuous.

is this a good idea?

VietDao29
Homework Helper
You are making it a mess. I doubt that you can really understand what you wrote. Mathematics is not a collection of, may I say, meaningless symbols, and signs. Be sure to express your ideas correctly so that others can understand. If you cannot understand what you wrote, then you cannot suppose us to be able to interprete them.
loop quantum gravity said:
if the function wasnt conitnuous then there exists e>0 and d>0 such that |x-x0|<d |f(x)-f(x0)|>=e
There's no such definition for discontinuity! What if f(x0) is undefined?
it is monotone, then suppose it's monotonic increasing then for x>y f(x)>f(y), by the intermediate property, any value value between f(x) and f(y), say c, such that x0 between x and y, and f(x0)=c f(x)>f(x0)>f(y) f(x)-f(x0)>=e, if we let e=f(x)-f(y) then f(x)-f(x0)>=f(x)-f(y) which is not possible.
Err, what???  ---------------------
Ok, let have a look back at Office_Shredder's hint:
I would try arguing by contradiction.... if the function WASN'T continuous at a point, what does that mean about the points around it?
Monotone function means that it can either be an increasing, or decreasing function. So, say if there's a discontinuity at x0. f(x0) is either missing (or undefined), or there'll be a jump there. So what happens, then?

Last edited:
Gold Member
i beg to differ i know that if a function is not continouous in a particular point then there exists e>0 and d>0 such that for |x-x0|<d |f(x)-f(x0)|>=e, this is the negation of continuity.

Gold Member
does this negation only applies to uniform continuity?

btw, i understand that if at point x0 it is discontinuous then the intermediate value doesnt apply cause f(x0) is not defined or missing as you put it, but still im quite sure about what i wrote that if f isnt continuous at x0 then |f(x)-f(x0)|>=e, isnt this the negation of continuity?

loop quantum gravity said:
i beg to differ i know that if a function is not continouous in a particular point then there exists e>0 and d>0 such that for |x-x0|<d |f(x)-f(x0)|>=e, this is the negation of continuity.
This isn't quite the negation of continuity. A function f is discontinuous at a point x0 in dom(f) if there exists an e>0 s.t. for all d>0 there is an x s.t. |x-x0| < d and |f(x) - (fx0)| >= e.

Do you see the difference? Notice that when you negate a statement containing quantifiers the "for alls" become "there exists" and vice versa. You should understand why this works.

For this problem it is fine to assume WLOG that f is an increasing function, because if f is decreasing then -f is increasing. We can conclude that f is continous if -f is continous since f = (-1)(-f). Recall the theorem that says if a function g is continuous then so is cg where c is a constant.

The theorem can be proven directly (no contradiction necessary). Note that f([a,b]) is an interval, call it I. You can show this function is continuous at x0 for three cases.
1) x0 is in (a,b)
2) x0 = a
3) x0 = b (this proof is very similar to case 2)
hint for case 1: there exists an E>0 s.t. (f(x0)-E, f(x0)+E) is a subset of I. Let e>0 and assume e < E. Show there exists a d>0 s.t. |x-x0|<d implies
|f(x) - f(x0)|<e.

Last edited:
Gold Member
i tried to appraoch this probelm directly and indirectly but so far instead of helping me you got me confused even more.

i know that AxFx=~Ex~Fx where E and A are the quantifiers and F is a predicate so i know that i needed to rephrase it as you stated.

anyway, one user tell me my definition is incorrect and another one just reinforces me.

anyway, for the first case x0 is in (x0-E,x0+E) such that f(x0) is in (f(x0-E),f(x0+E)) for any x in (x0-E,x0+E) x0-E<x<x0+E x-x0<E=d
but how do i deduce that |f(x)-f(x0)|<e?

loop quantum gravity said:
anyway, for the first case x0 is in (x0-E,x0+E) such that f(x0) is in (f(x0-E),f(x0+E)) for any x in (x0-E,x0+E) x0-E<x<x0+E x-x0<E=d
but how do i deduce that |f(x)-f(x0)|<e?

if e<E then $$f(x_0) - e, f(x_0) + e \in (f(x_0) - E, f(x_0) +E) \subseteq I$$
Thus there exists $x_1, x_2$ s.t. $$f(x_1) = f(x_0) - e$$ and $f(x_2) = f(x_0) + e$. Note that $x_0 \in (x_1, x_2)$. The choice of d should be apparent.

Last edited:
Gold Member
what happens is that f(x)<f(x0)+e.

but if this is such easy why no one suggested this way before you?

I never said this was easy. There were a couple of mistakes in my last two posts (major ones). I have fixed them now. I had (x0-E, x0+E) but it should have been (f(x0)-E, f(x0)+E). Sorry for the confusion.