Notation for maps: is "$A$" in "$\alpha : A \to B$" always the domain? According to the Wikipedia page on functions / maps (emphasis added):

A function is a process or a relation that associates each element x of a set X, the domain of the function, to a single element y of another set Y (possibly the same set), the codomain of the function.

It then goes on to say, in the subsection Specifying a function By a formula, from the same page (emphasis added):

For example, ${\displaystyle f(x)={\sqrt {1+x^{2}}}}$ defines a function $f\colon \mathbb{R} \to \mathbb{R}$ whose domain is ${\displaystyle \mathbb {R} ,}$ because ${\displaystyle 1+x^{2}}$ is always positive if $x$ is a real number. On the other hand, $f(x)=\sqrt{1-x^2}$ defines a function from the reals to the reals whose domain is reduced to the interval $[–1, 1]$.

which would seem to suggest that, for the latter function, one should write:
"let $f \colon \mathbb{R} \to \mathbb{R}$ be the function defined by the equation $f(x)  = \sqrt{1-x^2}$, valid for all $x \in [-1,1]$", i.e. $\mathbb{R}$ is not the domain, but some set containing the domain; however, in another subsection, Notation Arrow notation it says:

For explicitly expressing [the] domain $X$ and the codomain $Y$ of a function $f$, the arrow notation is often used (read: "the function $f$ from $X$ to $Y$" or "the function $f$ mapping elements of $X$ to elements of $Y$"):
$$f\colon X\to Y$$

which seems to imply that it is not correct to write $f: \mathbb{R} \to \mathbb{R}$ for the function $x \mapsto \sqrt{1-x^2}$, as the domain is not $\mathbb{R}$, nor is the codomain $\mathbb{R}$.

Should one write
$$ \begin{array}{ll}f\colon \mathbb{R} &\hspace{-0.6em} \to \mathbb{R} \\[5pt] & \hspace{-0.6em} x \mapsto \sqrt{1-x^2}, \end{array}$$
where $\mathbb{R} \to \mathbb{R}$ implies that the domain and image are subsets of $\mathbb{R}$, respectively? or should one write:
$$
\begin{array}{ll}f:[-1,1] & \hspace{-0.6em} \to [0,1] \\[5pt] & \hspace{-0.6em} x \mapsto \sqrt{1-x^2}, \end{array}
$$

N.B. My interest is not just pedantic: I have never studied maps, formally, and am trying to clarify whether a map from the set $A$ onto the set $B$ requires only that every element in $B$ be an image, or whether it also requires that every element of $A$ have an image, as well. I've consulted 2 different textbooks, as well as the Wikipedia page; unfortunately, although great care is given to distinguish the codomain and the image, all the explanations and examples provided do not address whether the domain is $A$ or if it may be a subset of $A$.
Moreover, several textbooks I've read have made much ado about the fact that one ought to distinguish between a function and a function of and imply that the distinction is to be found in these definitions (unfortunately, none of them consider it important enough to actually clarify within their own text).
 A: If you write $f : A \to B$ that is usually understood to mean that:

*

*for every $a \in A$, the value $f(a)$ is defined

*this value is an element of $B$.

So the domain has to be $A$. However, $B$ is not necessarily the image but just the codomain (i.e. it is acceptable for $f$ to not “hit” every value in $B$; however, if $f$ does "hit" every value in $B$, then the image is equal to the codomain).
For your definition $f(x) = \sqrt{1 - x^2}$, writing $f : \mathbb{R} \to \mathbb{R}$ would be considered wrong in most circumstances (people get sloppy sometimes, or figuring out the exact domain might be something they want you to do; writing $f : \mathbb{R} \to \mathbb{R}$ still sloppy in the latter case, though). So you have to be more precise in your domain, i.e. $f: [-1, 1] \to \mathbb{R}$ would be fine (note: you do not have to specify the image, just a superset of it), as would $f : [0,1] \to [0, 1]$ would (i.e. you can consider the function restricted to a subset of its maximal domain).
A: Consider this definition of function taken from Mathematical Proofs: A Transition to Advanced Mathematics by Chartrand et. al.:

Let $A$ and $B$ be nonempty sets. By a function from $A$ to $B$, written $f:A\rightarrow B$, we mean a relation from $A$ to $B$ with the property that every element $A$ is the first coordinate of exactly one ordered pair in $f$. Since $f$ is a relation, the set $A$ in this case is the domain of $f$... . The set $B$ is called the codomain of $f$. (216)

This particular definition assumes you know some things about relations. In short, a relation from a set $A$ to a set $B$ is a subset of the cartesian product of $A$ and $B$. Since a cartesian product is a set of ordered pairs, the authors choose to use the ordered-pair-formalism in their definition of a function, rather than referring to a function as a mapping or a process. I like this, and you might find it helpful.
Case in point, if $f:A\rightarrow B$ is a function, the set $A$ is always the domain. Furthermore, if not every element in $A$ is mapped to some element in $B$, $f$ is not a function. So I would disagree with the Wikipedia article you cited which claims the validity of the statement "$f(x)=\sqrt{1-x^2}$ defines a function from the reals to the reals whose domain is reduced to the interval $[-1,1]$." Since there exist elements in $\mathbb{R}$ $-$ namely every $x\in\mathbb{R}$ with $|x|>1$ $-$ which are not mapped to any element of $\mathbb{R}$ (the codomain), $f:\mathbb{R}\rightarrow\mathbb{R}$ defined by $f(x)=\sqrt{1-x^2}$ is not a function. Since the domain of $f$ should be $[-1,1]$ (as indicated in the Wiki article), the proper notation is $f:[-1,1]\rightarrow\mathbb{R}$; in this case, if $f$ is defined by $f(x)=\sqrt{1-x^2}$, $f$ is a function.
Another thing. The codomain is not necessarily equal to the image/range. As indicated in the definition I provided, the codomain is simply the set that all the second coordinates of the function $f$ belong to. The image/range, on the other hand, is the set of all second coordinates of the ordered pairs in $f$. The image is always a subset of the codomain, but it is not necessarily the same as the codomain. In other words, there could be elements in the codomain that are not second coordinates of any ordered pair in $f$. Considering the same function as in the previous paragraph, no $x\in\mathbb{R}$ is mapped to 2 (or any $x<0$ or $x>1$ for that matter), but it is still proper to say that the codomain of $f$ is $\mathbb{R}$.
The special case in which the image equals the codomain happens when $f$ is a surjection. The function $f:A\rightarrow B$ is a surjection when every element of $B$ is the second coordinate of an ordered pair in $f$. More formally, $f$ is a surjection when for all $b\in B$ there exists an $a\in A$ such that $f(a)=b$. Surjections are only special cases, though.
I hope this was helpful.
