I am looking at the following theorem in a set of notes:
Theorem 12.48. Suppose that $(A, <)$ is a simple order with no largest element. Then there is a strictly increasing function $f : \text{cf}(A) \to A$ such that $\text{rng}(f)$ is cofinal in $A$.
Proof. Let $X$ be a cofinal subset of $A$ of size $\text{cf}(A)$, and let $g$ be a bijection from $\text{cf}(A)$ onto $X$. We define a function $f:\text{cf}(A) \to X$ by recursion, as follows. If $f(\beta) \in X$ has been defined for all $\beta<\alpha$, where $\alpha< \text{cf}(A)$, then $\{f(\beta) : \beta < \alpha\}$ has size less than $\text{cf}(A)$, and hence it is not cofinal. Hence there is an $a \in A$ such that $f(\beta) < a$ for all $\beta<\alpha$. We let $f(\alpha)$ be an element of $X$ such that $a, g(\alpha) \leq f(\alpha)$. Clearly $f$ is strictly increasing. If $a \in A$, choose $\alpha < \text{cf}(A)$ such that $a ≤ g(\alpha)$. Then $a \leq f(\alpha)$.
Questions:
I don't see where the assumption of no largest element came into play?
Why do we map $f$ into $X$ and not simply into $A$? (i.e. let $f(\alpha)=\max\{a,g(\alpha)\}$). It seems to me we need the axiom of choice to choose $f(\alpha)$ in $X$.
Do we need the axiom of choice to choose $a$?
You are right. It doesn't. It's just that an order with a maximum has a cofinality of $1$. That's not interesting and we don't need to pay any attention to that case.
Choosing the maximum between two points in a linear order does not require choice. Of course, choice was used so heavily already in that $X$ can be well-ordered, and so on. What's one more use amongst friends?
Well, if you know there is a cofinal subset which is well-orderable (note that a subset is cofinal if, essentially, it is unbounded), then there is no need for the axiom of choice. We can just work inside such a subset. But in general, given an arbitrary linear order the existence of a well-orderable cofinal subset requires using the axiom of choice. For example, no such subset can be found in a linearly ordered infinite Dedekind finite set.