The hard continuity problem that you are facing is indeed a challenging one. It requires a deep understanding of continuity and function behavior. Let me try to provide some insight and guidance to help you solve this problem.
Firstly, let's start with the easier part - finding an example of a function that is continuous everywhere and takes each of its values exactly 3 times. One possible function that satisfies this condition is f(x) = x^3. This function is continuous everywhere and takes each value exactly three times. For example, f(1) = 1, f(2) = 8, f(3) = 27, and so on.
Now, let's move on to the harder part - proving that there is no such function if there are two values instead of three. To prove this, we need to show that it is impossible for a function to be continuous everywhere and take only two values. This can be done by contradiction.
Assume that there exists a function f(x) that is continuous everywhere and takes only two values, let's say a and b. Without loss of generality, let a < b. Since f(x) is continuous everywhere, it must also be continuous at the point (a + b)/2. This means that for any ε > 0, there exists a δ > 0 such that if |x - (a + b)/2| < δ, then |f(x) - f((a + b)/2)| < ε.
Now, let's consider the points a, (a + b)/2, and b. Since f(a) = f((a + b)/2) = f(b), by the intermediate value theorem, there exists a point c between a and (a + b)/2 such that f(c) = a. Similarly, there exists a point d between (a + b)/2 and b such that f(d) = b.
But this means that f(x) takes the value a at two different points, c and (a + b)/2, violating the condition that f(x) takes each value exactly three times. This contradiction proves that there is no such function that is continuous everywhere and takes only two values.
In conclusion, the hard continuity problem can be solved by providing an example of a function that is continuous everywhere and takes each value exactly three times, and then proving that it is impossible for a function to be continuous everywhere and take only two values. I