How far can one get in analysis without leaving $\mathbb{Q}$? Suppose you're trying to teach analysis to a stubborn algebraist who refuses to acknowledge the existence of any characteristic $0$ field other than $\mathbb{Q}$.  How ugly are things going to get for him?
The algebraist argues that the real numbers are a silly construction because any real number can be approximated to arbitrarily high precision by the rational numbers - i.e., given any real number $r$ and any $\epsilon>0$, the set $\left\{x\in\mathbb{Q}:\left|x-r\right|<\epsilon\right\}$ is nonempty, thus sating the mad gods of algebra.
As @J.M. and @75064 pointed out to me in chat, we do start having some topology problems, for example that $f(x)=x^2$ and $g(x)=2$ are nonintersecting functions in $\mathbb{Q}$.  They do, however, come arbitrarily close to intersecting, i.e. given any $\epsilon>0$ there exist rational solutions to $\left|2-x^2\right|<\epsilon$.  The algebraist doesn't find this totally unsatisfying.

Where is this guy really going to start running into trouble?  Are there definitions in analysis which simply can't be reasonably formulated without leaving the rational numbers?  Which concepts would be particularly difficult to understand without the rest of the reals?

 A: What kind of algebraist "refuses to acknowledge the existence of any characteristic $0$ field other than $\mathbb{Q}$"??  But there is a good question in here nevertheless: the basic definitions of limit, continuity, and differentiability all make sense for functions $f: \mathbb{Q} \rightarrow \mathbb{Q}$.  The real numbers are in many ways a much more complicated structure than $\mathbb{Q}$ (and in many other ways are much simpler, but never mind that here!), so it is natural to ask whether they are really necessary for calculus.
Strangely, this question has gotten serious attention only relatively recently.  For instance:
$\bullet$ Tom Korner's real analysis text takes this question seriously and gives several examples of pathological behavior over $\mathbb{Q}$.
$\bullet$ Michael Schramm's real analysis text is unusually thorough and lucid in making logical connections between the main theorems of calculus (though there is one mistaken implication there).  I found it to be a very appealing text because of this.
$\bullet$ My honors calculus notes often explain what goes wrong if you use an ordered field other than $\mathbb{R}$.
$\bullet$ $\mathbb{R}$ is the unique ordered field in which real induction is possible.
$\bullet$ The most comprehensive answers to your question can be found in two recent Monthly articles, by Jim Propp and by Holger Teismann.
But as the title of Teismann's article suggests, even the latter two articles do not complete the story.
$\bullet$ Here is a short note whose genesis was on this site which explains a further pathology of $\mathbb{Q}$: there are absolutely convergent series which are not convergent.
$\bullet$ Only a few weeks ago Jim Propp wrote to tell me that Tarski's Fixed Point Theorem characterizes completeness in ordered fields and admits a nice proof using Real Induction.  (I put it in my honors calculus notes.)  So the fun continues...
A: I think he's in trouble when you ask him what the length of the diagonal of a unit square is.
A: Even in the OP you've already went past the point where your stubborn algebraist runs into trouble: you started talking about functions. But if your algebraist doesn't believe in characteristic zero fields like $\mathbb{Q}(x)$, then he can't believe in functions either!
A less stubborn algebraist can get pretty far without giving in and accepting the reals though. Introducing number fields as needed to deal with algebraic irrationals, or dealing with all of them by using the algebraic closure of the rationals. Better yet, there is the real closure of the rationals -- the set of algebraic irrational numbers with imaginary part zero -- which is a real closed field, meaning that it has exactly the same properties as the real numbers do, so long as one sticks to things that can be described in terms of polynomials and inequalities. (in particular, nothing that requires induction is allowed, since you can't describe the integers with polynomials and inequalities)
There are purely algebraic formulations of notions like differentiation and manifolds. Antiderivatives would exist less frequently, but they could be added formally as needed, and (co)homology can play many of the purposes one uses integration for anyways. Many things one can do with trig functions can be done with suitable rational functions instead (e.g. see the Chebyshev polynomials). There are exponential rings and modules related to differentiation and lots of other stuff I have little familiarity with (and many more I've probably never even heard of)
The main trouble the less stubborn algebraist will run into is that things will become progressively more complicated the more he tries to include. Or maybe some of the purely algebraic facts whose only known proofs are analytic.
Either that, or formal power series rings would give him trouble, since despite their algebraic use, allowing them would make it more difficult to justify avoiding the construction of $\mathbb{R}$.
A: The fact that the only functions on an interval with derivative zero everywhere are constants is at the heart of applications to science. This fact is equivalent to the completeness axiom. Continuity, differentiation and intervals make sense in any ordered field but if there exists a nonempty set with an upper bound but no least upper bound, then there exists a non-constant function with derivative zero everywhere.
A: This situation strikes me as about as worthwhile a use of your time as trying to reason with a student in a foreign language class who refuses to accept a grammatical construction or vocabulary word that is used every day by native speakers. Without the real numbers as a background against which constructions are made, most fundamental constructions in analysis break down, e.g., no coherent theory of power series as functions.  And even algebraic functions have non-algebraic antiderivatives: if you are a fan of the function $1/x$ and you want to integrate it then you'd better be ready to accept logarithms. The theorem that a continuous function on a closed and bounded interval is uniformly continuous breaks down if you only work over the rational numbers: try $f(x) = 1/(x^2-2)$ on the rational closed interval $[1,2]$.
Putting aside the issue of analysis, such a math student who continues with this attitude isn't going to get far even in algebra, considering the importance of algebraic numbers that are not rational numbers, even for solving problems that are posed only in the setting of the rational numbers. This student must have a very limited understanding of  algebra. After all, what would this person say about constructions like ${\mathbf Q}[x]/(x^2-2)$?
Back to analysis, if this person is a die hard algebraist then provide a definition of the real numbers that feels largely algebraic: the real numbers are the quotient ring $A/M$ where $A$ is the ring of Cauchy sequences in ${\mathbf Q}$ and $M$ is the ideal of sequences in ${\mathbf Q}$ that tend to $0$. This is a maximal ideal, so $A/M$ is a field, and by any of several ways one can show this is more than just the rational numbers in disguise (e.g., it contains a solution of $t^2 = 2$, or it's not countable). If this student refuses to believe $A/M$ is a new field of characteristic $0$ (though there are much easier ways to construct fields of characteristic $0$ besides the rationals), direct him to books that explain what fields are.
A: I did my undergrad project on "Analysis in a rational world", because it seemed like fun. It turns out that using definitions over $\mathbb{Q}$ means you can solve $d^n F/d x^n=G(x,F,dF/dx,\ldots,d^{n-1}F/dx^{n-1})$ with each derivative bijective on almost whatever interval you like. Fun, but not very like real analysis.
A: The Bolzano-Weierstrass, Cantor's theorem, and other theorems which essentially talk about compactness of closed intervals will become messy.
Whereas every bounded sequence of real numbers have a convergent subsequence, if you take a sequences of rational numbers which converges to $\sqrt 2$ it does not have a convergent subsequence in $\Bbb Q$.
Similarly, the intersection of decreasing sequences of closed intervals is no longer guaranteed to be non-empty. And I am quite certain that we can somehow find a way to construct a continuous function on a bounded interval which is not uniformly continuous.
A: What counts as “without leaving $\mathbb{Q}$”? Suppose our framework for theorising about the rationals is the axiomatizable fragment of second-order logic which only allows predicative instances of comprehension. That framework arguably is logic, not set theory in disguise, and the resulting second-order theory is arguably talking about nothing over and above the rationals. But such a theory will be equivalent in strength to the weak second-order arithmetic $\mathsf{ACA_0}$, in which it is well known that we can reconstruct classical analysis and a lot more besides.
Turn the OP's question around a bit: how much beyond a (first-order) theory of the rationals is actually required to reconstruct classical analysis? This question has been intensively investigated in the project of Reverse Mathematics (which I'm surprised others haven't mentioned yet): in headline terms, the answer is “very much less than you would have imagined”. If the project is not familiar to you, the place to start is with the freely available first chapter of Stephen Simpson's now classic book.
A: I think it is worth point out that limiting oneself to the rational numbers means that certain analytical number theory results that can only be established with real or complex numbers cannot work out merely by rational numbers. The huge problem we had with $\mathbb{Q}$ is not merely analytical, but also algebraic. Any elementary theory methods which only employ addition, subtraction, division cannot distinguish $\mathbb{Q}$ and other fields if we start with $\mathbb{Z}$. So in some sense $\mathbb{Q}$ gives the limit of elementary number theory.
A: Real numbers are needed to establish new theorems. For example $\exists L \neq 0$ s.t. $\sin(x) = \sin(x+L)$ isn't true if we restrict the definition of domain to rational numbers. You may restrict the definition of domain even more to obtain a function s.t. $f: D \rightarrow \mathbb{Q} \ , \ \ f(x) = \sin(x)$, but it restricts the possibilities of choosing suitable numbers $L\in \mathbb{Q}$. Hence there will not be such a number.
Real numbers were needed to express the solutions of $x^2 = 2$. Of course we can restrict the range of applications, but it discloses for example finding the side length of a square, when area is known. This has also geometrical significance. It is known, that there is a way to construct $\sqrt{x}$ from $x$ using pencil and compasses. So there is a way to see the solution. So there is left to make a sufficiently general and simple construction for numbers (real numbers).
