That depends on your definition of "elementary function" and some conventions of notation.
For example, is ##f(x) = 1/x## an "elementary function"?
If we adopt the convention that "##f:A \rightarrow B##" designates ##A## as the domain of ##f## and declare that the domain of ##A## is exactly set of numbers that appear as first elements in the ordered pairs ##f## then (speaking of real valued functions of the reals) the domain of ##f(x) = 1/x## is not all of ##\mathbb{R}##
However, as
@Mark44 indicates, sometimes the notation "##f:A \rightarrow B##" is used merely to indicate the that the domain of ##f## is a
subset of ##A##. This is especially true when authors are expressing the idea that their remarks apply only to real valued functions of 1 real variable. They might write "##f:\mathbb{R}\rightarrow\mathbb{R}##" when what should be written is "##f:A\rightarrow B, A \subset \mathbb{R}, B \subset\mathbb{R}##"According to the current Wikipedia article
https://en.wikipedia.org/wiki/Codomain, the "codomain" of a function is distinct from the "image" of a function. So, as
@Mark44 indicated, the notation "##g(f(x))##" refers to a function whose domain is the
image of ##f##.
With the understanding that we are speaking of real valued functions of one real variable, the domain of ##f## is ##[0,+\infty)##.
The Wikipedia article mentions several different definitions of "function" It takes, what I think is the standard view that the "codomain" of a function is a somewhat arbitrary set. For example, one could define a function ##f(x) = sin(x)## and specify its codomain as [-1,1] and define a (technically) different function as ##f(x) = sin(x)## with codomain [-3,17] or some other arbitrary set containing the
image of
f(x) = sin(x). Taking the viewpoint that the codomain has this arbitrary aspect to it, the codomain of the composition of two functions is not uniquely determined unless an author has specified some rule for how it is determined.
Some authors might define the notation ##g \circ f## to mean a function whose codomain is
exactly ##g(f(A))## where ##f(A)## is the image of ##f##. Other authors might take the viewpoint that "I'm talking about real valued functions in this book, so the codomain of all functions that I mention will be ##\mathbb{R}##".
Unfortunately, mathematical notation can be ambiguous.