This is to be found in the answer to problem 26 (b) of chapter 5 of Michael Spivak's Calculus 3rd edition. The problem reads as follows:
26 Give examples to show that the following definitions of $\lim_{x\to a}f(x)=\ell$ are not correct.
(b) For all $\varepsilon > 0$ there is a $\delta > 0$ such that if $|f(x) - \ell| < \varepsilon$, then $0<|x-a| < \delta$.
I thought of constant functions because they do not satisfy this condition, but approach a limit "everywhere". This means, let $f(x)=c, c\in \mathbb R$ and let $a\in \mathbb R$ and let $\varepsilon > 0$, then $|f(x) - c|=0 < \varepsilon$ for all $x$ satisfying $0<|x-a| < \delta$ for any $\delta > 0$ and not just some $\delta > 0$. (It is already shown in the text of this chapter that $\lim_{x\to a}c=c$.)
In his answer Spivak also mentions constant functions but then adds the following:
Moreover, the function $f(x)=x$, for example, satisfies this condition no matter what $a$ and $\ell$ are.
What does he mean by that? It seems to me that if $|f(x) - \ell| < \varepsilon$ holds, then $|x - \ell| < \varepsilon$ so $a=\ell$ does hold, which means it does matter what $a$ and $\ell$ are. Unfortunately, I really don't understand what he is getting at.
This is true.
This is also true, but not necessary. You have assumed that $\delta$ is small (equal to $\varepsilon$), but this need not be the case. We are free to chose $\delta$ as we please, so $|a-l|$ can actually be as big as we like (using this incorrect definition).
In the true definition, we are asking "Can we find $x$ close enough to $l$ such that $|f(x) - l| < \varepsilon$". In the bad definition above, we are asking "Can we find a $\delta$ big enough such that if $|f(x) - l| < \varepsilon$, then $|x - a| < \delta$".
The important thing to take note of is the order which each section appears. Let's break down the 'definition' given in the question step by step to see where we go wrong.
Step 1 - What is given?
We are trying to show that $\lim_{x\to a} f(x) = l$, so $a$ and $l$ are fixed.
Step 2 - Choose an epsilon
We have been told that what follows must hold for all $\varepsilon > 0$, so we let $\varepsilon > 0$ be arbitrary but, from this point onwards, fixed.
Step 3 - Find a delta
We want to find a $\delta$ that 'works'. By this we mean, can we find a $\delta$ such that, if |$f(x) - l| < \varepsilon$ then $|x-a| < \delta$?
Suppose that $|f(x) - l| < \varepsilon$. Then, by definition of $f$, $|x-l| < \varepsilon$, so we have $x$ being 'close' to $l$. Can we find a delta such that $|x-a| < \delta$? Sure we can! We just pick delta to be as big as we need. So, using this definition, as long as we pick $\delta$ large enough, it works for all choices of $a$ and $l$.
Example
Let's consider the following example:
Let $\varepsilon > 0$ be arbitrary. We seek $\delta > 0$ such that, if $|x-27|<\varepsilon$, then $|x - 5| < \delta$.
If $|x - 27| < \varepsilon$, and $\delta > 22 + \varepsilon$, then \begin{align*} |x - 5| &= |x - 5 + 27 - 27| \\ &\leq |x - 27| + |-5 + 27| \\ &= |x - 27| + |22| \\ &< \varepsilon + 22 \\ &< \delta \end{align*}
Hence $\lim_{x\to 5}f(x) = 27$.
Clearly, this is nonsense, but it is a good exercise in demonstrating why the order of the statements in the definition is important.