How to deal with infinite continued fractions in formal language? A continued fraction is an expression obtained through an iterative process of representing a number as the sum of its integer part and the reciprocal of another number, then writing this other number as the sum of its integer part and another reciprocal, and so on.
Continued fractions can be infinite,
e.g.
$$
a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\ddots}}}
$$
So it seems a term of first-order language. However, every term in first-order language has finite depth, compared with continued fractions, they have depth $\omega$, used individual and function symbols infinite times, hence are not a proper terms of first-order language. 
So my question: Is there an extension of first-order language that can admit this kind of expression?
 A: When such things are reasoned about formally, set theory is usually assumed as a background theory.
Formal set theory is itself a first-order theory, but provides enough machinery that higher-order concepts can be modeled in a fairly direct way.
In this case, a continued fraction would be modeled formally as a sequence of naturals, which is again a function $\mathbb N\to \mathbb N$; a function $f$ is modeled as the set of ordered pairs $\langle x,f(x)\rangle$ for all $x$ in its domain, and the ordered pair $\langle x,y\rangle$ is represented by the set $\{\{x\},\{x,y\}\}$. So in the end everything can be reduced to sets.
(Which does, of course, not mean that everything should be reduced to set theory all of the time. Most ordinary mathematical reasoning is better served by imagining one is working in a richly-typed higher-order setting. Being prepared to deliver the set-theoretical formalization if a foundational challenge should arise is quite sufficient; one doesn't need to do so spontaneously).
