Prove that an integervalued continuous function on R must be
Solution
It is not necessarily true unless the domain is connected.
If the domain XX is connected and ff is continuous, then f(X)f(X) is also connected. The only connected subsets of the integers are sets containing at most one point. Hence f(X)f(X) (which is presumably non-empty) has exactly one point and ff is constant on XX.
Another approach is to suppose that y1=f(x1),y2=f(x2)y1=f(x1),y2=f(x2). Suppose y1y2y1y2 without loss of generality. Then by the intermediate value theorem, ff must take all the values in [y1,y2][y1,y2]. However, since the range is the integers, this can only be true if ff only takes one value.
Here\'s a third approach: Since ff is continuous, for each x0x0 we can find a >0>0 such that if |xx0|<|xx0|<, then |f(x)f(x0)|<12|f(x)f(x0)|<12. Since ff is integer valued, this means that f(x)=f(x0)f(x)=f(x0)for all |xx0|<|xx0|<.
Now let t+=sup{x|f(x)=f(0)}t+=sup{x|f(x)=f(0)}. If t+<t+<, then by continuity, we must have f(t+)=f(0)f(t+)=f(0), and by the previous paragraph, there is a >0>0 such that f(x)=f(t+)f(x)=f(t+) for all xx satisfying |xt+|<|xt+|<, which contradicts the definition of t+t+. Hence t+=t+=. Applying the same approach to t=inf{x|f(x)=f(0)}t=inf{x|f(x)=f(0)} shows that t=t=, hence f(x)=f(0)f(x)=f(0) for all xx.
| It is not necessarily true unless the domain is connected. If the domain XX is connected and ff is continuous, then f(X)f(X) is also connected. The only connected subsets of the integers are sets containing at most one point. Hence f(X)f(X) (which is presumably non-empty) has exactly one point and ff is constant on XX. Another approach is to suppose that y1=f(x1),y2=f(x2)y1=f(x1),y2=f(x2). Suppose y1y2y1y2 without loss of generality. Then by the intermediate value theorem, ff must take all the values in [y1,y2][y1,y2]. However, since the range is the integers, this can only be true if ff only takes one value. Here\'s a third approach: Since ff is continuous, for each x0x0 we can find a >0>0 such that if |xx0|<|xx0|<, then |f(x)f(x0)|<12|f(x)f(x0)|<12. Since ff is integer valued, this means that f(x)=f(x0)f(x)=f(x0)for all |xx0|<|xx0|<. Now let t+=sup{x|f(x)=f(0)}t+=sup{x|f(x)=f(0)}. If t+<t+<, then by continuity, we must have f(t+)=f(0)f(t+)=f(0), and by the previous paragraph, there is a >0>0 such that f(x)=f(t+)f(x)=f(t+) for all xx satisfying |xt+|<|xt+|<, which contradicts the definition of t+t+. Hence t+=t+=. Applying the same approach to t=inf{x|f(x)=f(0)}t=inf{x|f(x)=f(0)} shows that t=t=, hence f(x)=f(0)f(x)=f(0) for all xx. | 

