Show that the following function is continuous only at x=0 :

f(x) = x for x rational
-x for x irrational

To show that the function f(x) is continuous only at x = 0, we need to examine its behavior around this point.

First, let's consider the rational values of x. When x is rational, f(x) = x. So, we have to determine whether the function approaches a limit as x approaches 0 from the rational side.

If we approach 0 from the rational side, for any given positive ε, we can find a positive δ such that |f(x) - f(0)| = |x - 0| = |x| < ε whenever 0 < |x - 0| < δ. This means that as x gets arbitrarily close to 0, f(x) gets arbitrarily close to 0 as well (since |x| becomes arbitrarily small).

Now, let's consider the irrational values of x. When x is irrational, f(x) = -x. So, we have to determine whether the function approaches a limit as x approaches 0 from the irrational side.

If we approach 0 from the irrational side, for any given positive ε, we can find a positive δ such that |f(x) - f(0)| = |-x - 0| = |-x| = x < ε whenever 0 < |x - 0| < δ. Since x is always positive when approaching 0 from the irrational side, we can see that f(x) does not approach a limit of 0 as x approaches 0, but rather approaches a limit of -0 (which is just 0).

Therefore, since f(x) approaches different limits (0 for rational values and -0 for irrational values) as x approaches 0 from different sides, we can conclude that the function f(x) is only continuous at x = 0.