Explanation Of Continuity Can continuity be explained graphically? If yes then how to explain the continuity of complicated function such as $f(x)=x^2$ if $x$ is rational and $f(x)=2x$ if $x$ is irrational.
 A: This function exhibits continuity only at the two values of $x$ for which $x^2=2x$ (namely, $x=0$ and $x=2$ [Corrected, thanks to @Arthur]). Still, you could explain it somewhat graphically as follows.
Consider the first point, where $x=0$ and $f(x)=0$. Suppose I draw two horizontal lines (one above $(0,0)$ and one below it). Then no matter how close to $y=0$ these lines are, you can always draw two vertical lines (one to the left of $(0,0)$ and one to the right of it) so that the part of the graph of $f$ between the vertical lines lies completely inside the rectangle bounded by the four lines.
Note that your choice of the vertical lines will depend on what horizontal lines I have specified. The tighter I draw the horizontal lines, the tighter you must draw the vertical lines -- but you always can do it. That's the definition of continuity at that point.
The same will be true at the second point, where $x=2$ and $f(x)=4$.
And, in fact, it is impossible to do this at any other point on the graph of $f$, which demonstrates that $f$ is not continuous anywhere else.
A: Here is more or less MPW's answer with figures. First, let's plot your function. It looks roughly like this:

One curve is for the rational inputs, and one curve for the irrational ones.
Now, let's pick a point where we want to check for continuity. I'll take $x = 2$.
So, we mark $x = 2$, and $y = f(2) = 4$ on the graph:

Then we are given an $\varepsilon>0$ (I have drawn $\varepsilon = \frac12$), and we mark the region where $|f(2)-y|<\varepsilon$.

Now, the question is, can we find a $\delta>0$, and similarily mark the region where $|2-x|<\delta$ in such a way that within that region, the function doesn't go outside the blue $\varepsilon$-lines? The answer is yes, we can (here $\delta = 0.1$):

In order to prove continuity, you have to be able to do this no matter how small $\varepsilon$ is, which is to say no matter how narrow those two blue lines are. And at this point it looks like that's possible (nothing can be proven by just looking at a graph).
Maybe you can see how this would fail for, say, $x = 1$. If not, draw it up on a piece of paper, follow the procedure, choose a small enough $\varepsilon$ (anything smaller than $1$ works, so try with, say, $\frac12$) and see what happens.
