# Show that $f(x) = |x|$ is continuous on $\mathbb R$

I want to use the sequential criterion to prove that $f(x) = |x|$ is continuous on $\mathbb R$.

For reference, here is the sequential criterion according to Introduction to Real Analysis by Bartle:

$f:A \rightarrow \mathbb R$ is continuous at the point $c\in A$ if and only if for every sequence $(x_n)$ that converges to $c$, the sequence $(f(x_n))$ converges to $f(c)$.

So my attempt was this: Let $x \in \mathbb R$ and define the sequence $(x_n) = x + \frac{1}{n}$ for $n \in \mathbb N$ so $(x_n)$ converges to $x$. Then $(f(x_n)) = |x_n| = |x + \frac{1}{n}|$ so $(f(x_n))$ converges to $|x|$. Since this is true for all $x \in \mathbb R$, therefore $f(x) = |x|$ is continuous on $\mathbb R$.

My main source of doubt comes from that it seems you can show a lot of functions are continuous simply by slapping on a "$+\frac{1}{n}$". Is this proof valid? Or is there a constraint that I am not meeting?

• you proved it for only one convergent sequence to $c$... but you need to prove that for every sequence $(x_n)$ that converges to $c$ then $(f(x_n))$ converges to $f(c)$. Jul 13, 2017 at 20:37

You're right to doubt that! The sequential criterion you want to apply requires convergence for "every sequence". That's an important word. It's not enough to prove convergence for a sequence of your own choice. You have to prove it for an arbitrary sequence, which might not have any intelligible formula at all. The only thing you can assume about $(x_n)$ is that it converges to $c$. You don't know how fast it converges, or whether it's monotonic, etc.

Also, in this part of your argument:

Then $(f(x_n)) = |x_n| = |x + \frac{1}{n}|$ so $(f(x_n))$ converges to $|x|$.

That "so" is not justified. It would be justified if we already knew that the absolute value is continuous, but you can't assume that; you're trying to prove it!

You can take Opal E's advice on how to start the proof. And by the way, it may be helpful to consider the cases $c>0,c=0,c<0$ separately.

This is not appropriate. Notice that the sequential criterion says that for EVERY sequence that converges to c.

You have only looked at a single sequence, the sequence $x+1/n$.

Instead, you would have to start your proof "Let $(x_n)$ be a sequence that converges to $(c)$. Then, from this, use the definition of sequence convergence to derive that $f(x_n)$ converges to $f(c)$.

Edit: By your approach, the function $f(x) = 0,$ if x is rational and 1, if x is irrational, would be continuous at all rational points! That's a problem, isn't it?

• Good answer -- you may want to replace $x_0$ with $c$ for consistency with OP's notation. Jul 13, 2017 at 20:26
• Good idea -- changed! Jul 13, 2017 at 20:28

You can make this easier if you just split the -function into cases: $|x|=x$ if $\geq0$ and $|x|=-x$ otherwise. Then for the first case, what you need to show is, essentially, tautological : $(x_n \rightarrow x ) \rightarrow (x_n \rightarrow x)$ , since $f(x)=x$ in this case. Essentially the same for $f(x)=-x$.