Pet Peeve (notation for limits assumes uniqueness...) I suppose I should disguise this rant as a question.
Q: Are there any calculus books that give the definition of limits in a logically correct manner? (See below for the problem I'm complaining about with the typical presentation.)
Teaching baby complex. The book defines "$\lim_{z\to a}f(z)=w$" as usual, and then of course the first result is that limits are unique if they exist:


Thm. If $\lim_{z\to a}f(z)=w_1$ and $\lim_{z\to a}f(z)=w_2$ then $w_1=w_2$.


This appears literally trivial:
"Proof." $w_1=\lim_{z\to  a}f(z)=w_2$, qed.
There are a few sharp students in the class, actually interested in math, so I feel I should point out why that's bogus; the theorem as stated looks like it has zero content.
The point is we have no business using the notation $\lim_{z\to a}f(z)$ until after we've proved uniqueness, because the notation, especially if read "the limit..." presupposes uniqueness.
To do it right we should instead  define "$f(z)\to w$ as $z\to a$", prove uniqueness, and then introduce the notation $\lim$. Making it clear why uniqueness is actually something that requires proof...
 A: When I teach limits in advanced calculus, the first step is teaching the definition of convergence of a sequence: 

Definition: Given a sequence of real numbers $(x_n)$ and a real number $L$, the sequence $(x_n)$ converges to $L$ if [... we all know what goes here ...]

After a few simple examples, I immediately prove: 

Theorem: Given a sequence of real numbers $(x_n)$ and real numbers $L,M$, if the sequence $(x_n)$ converges to $L$ and the sequence $(x_n)$ converges to $M$ then $L=M$. 

and then I define 

Definition: $\lim_{n \to \infty} x_n$ is equal to the unique number to which $(x_n)$ converges.

where the previous theorem is used to justify uniqueness, and therefore well-definedness.
I see that my textbook does indeed follow this same line of development: Advanced Calculus, by Patrick M. Fitzpatrick.
A: I prefer to think of presenting these ideas in the "wrong" order as an abuse of notation. They've said something like:

Write $\lim_{z\to a}f(z)=L$ iff $\forall\epsilon>0\exists\delta>0\forall z\ne a(|z-a|<\delta\implies|f(z)-L|<\epsilon)$. By the triangle inequality, if such an $L$ exists for given $a,\,f$ it is unique, thereby mandating the notation $\lim_{z\to a}f(z)$ for $L$.

whereas you'd recommend:

Call $L$ a $z\to a$ limit of $f(z)$ iff $\forall\epsilon>0\exists\delta>0\forall z\ne a(|z-a|<\delta\implies|f(z)-L|<\epsilon)$. By the triangle inequality, if such an $L$ exists for given $a,\,f$ it is unique, thereby mandating the notation $\lim_{z\to a}f(z)$ for this $L$.

Every time you see someone write $f(n)=O(g(n))=O(h(n))$ when they really mean something like $f(n)\in O(g(n))=O(h(n))$, you encounter a similar abuse of notation in which we write $=$ when we mean "this would be an example of that" (never mind for the moment whether "this" is on the left- or right-hand side of the spurious $=$), but it doesn't matter because of an appropriate trivial uniqueness result.
I think part of the reason this can be so annoying is the slow build-up of the ideas. I don't know whether any specific textbook (or online PDF, for that matter) takes the second textbox's approach, but perhaps you'll find something that makes either approach so succinct readers don't have time to be misled. Whether it should be that succinct is a tricky issue.
A: This kind of stuff annoys me too.
Unfortunately, I can't give a book recommendation, but I can recommend a way to present the material. First, teach that $$\lim_{x \rightarrow a} f(x),$$ is, in general, a set. For instance, if $f : X \rightarrow Y$ is a function between topological spaces, we can define that $\lim_{x \rightarrow a} f(x)$ equals the set of all $y \in Y$ such that for every punctured neighbourhood $B$ of $y$, there is a punctured neighbourhood $A$ of $x$ such that the image of $A$ is a subset of $B$.
(You can replace this with the real analysis definition if it's more appropriate.)
Then you can prove that $$\lim_{x \rightarrow a} f(x)$$ has at most one element assuming the codomain is Hausdorff. Or if that's too advanced, do it all using metric spaces. Then you explain that when people say that the limit exists, they mean that it has at least one element. Then you add a further stipulation that we'll tend to identify $x$ with the singleton $\{x\}$ except in situations where this can cause confusion. Thus, one can typically regard $\lim_{x \rightarrow a} f(x)$ as an element of $Y$, unless it's the empty set. You can then explain the concept of a partial function. A partial function $X \rightarrow Y$ is:


*

*A pair $(A,f),$ where $A$ is a subset of $X$ and $f : A \rightarrow Y$ is a function. (Remark: The set $A$ in definition (1) is sometimes called the domain of definition of the partial function. I prefer to call it the preimage.)

*A function $X \rightarrow Y + 1$.

*A function $X \rightarrow \mathcal{P}_{\leq 1}(Y)$.
The reason $2$ and $3$ are the same is because $x$ and $\{x\}$ are basically the same thing (except in very specific set theoretic-contexts where they have to be regarded as different).
So, what have we learned?
Given a function $f : X \rightarrow Y$ between Hausdorff topological spaces, we get a partial function $$a \in X \mapsto \lim_{x \rightarrow a}f(x)$$ going from $X$ to $Y$. Lets call this $\mathrm{Lim}(f)$. Think of $\mathrm{Lim}(f)$ as our best attempt at getting rid of any discontinuities in $f$. You can then explain that the failure to be continuous can arise from two sources. One source is that the preimage of $\mathrm{Lim}(f)$ may not be all of $X$. For example, consider $f(x) = 1/x$ with $f(0)$ defined to be $17$. The second source is this: even if the preimage of $\mathrm{Lim}(f)$ is all of $X$, nonetheless $\mathrm{Lim}(f)$ might be distinct from $f$. For example, consider $f(x) = x$ for $x \neq 21$ and define $f(21)=-35$.
By the way, this way of thinking about limits (namely, as sets) really helps with writing comprehensible proofs involving them. Take this imvho borderline-flawed MIT proof that differentiability implies continuity. My issue is with the step $$\mathrm{lim}_{x \rightarrow a} f(x)g(x) = \mathrm{lim}_{x \rightarrow a} f(x) \mathrm{lim}_{x \rightarrow a}g(x).$$ This is, of course, untrue in general, and needs to be carefully justified in every special case where it's invoked.
And yet with the limits-as-sets viewpoint, we don't need any careful justification in this particular case. Indeed, we can just replace this "law" with $$\mathrm{lim}_{x \rightarrow a} f(x)g(x) \supseteq \mathrm{lim}_{x \rightarrow a} f(x) \mathrm{lim}_{x \rightarrow a}g(x),$$ which is actually true in full generality, and which is also enough to get the proof that differentiability implies continuity to work (try it).
