Show that a language is decidable iff some enumerator enumerates the language in lexicographic order
It's easier to think of $A$ as a list of natural numbers. If $A$ is decidable, then we can list all numbers in $A$ in increasing order by just testing all of them in order – Is $0 \in A$? Is $1 \in A$? And so on.

Now let us show that if $A$ can be enumerated in increasing order, then we can decide $A$. Let us try to use the following algorithm:


  On input $n$, enumerate all integers in $A$ in increasing order until a number $m \geq n$ appears. If $n$ has appeared, then clearly $n \in A$. If $n$ has not appeared, then $n \notin A$.


To see why the last point holds, suppose that $n=5$, and the enumeration starts $2,3,6$. At the point when we see 6, we know that 5 is never going to appear.

There is one problem with this algorithm – if $A$ is a finite language, then a number $m \geq n$ might never appear. Indeed, suppose for example that $A = \{2,3,5\}$ and that $n=6$. We see $2,3,5$, and then wait forever for a larger number to appear. We fix this problem in the following way:


If $A$ is finite, it is clearly decidable.
If $A$ is infinite, then the algorithm described above always terminates (why?).


Unfortunately, given just an enumerator for $A$, we (provably) cannot know whether $A$ is infinite or not, and so we don't know which of the two cases to use. Fortunately, this does not matter for the proof. All we need to do is show that if $A$ has an enumerator, then it has a decider. There is no requirement to turn an enumerator for $A$ into a decider for $A$ in a uniform fashion.