If $f(x)$ and $g(x)$ are functions, the composition of $f(x)$ and $g(x)$ is defined to be
$$ (f \circ g)(x) = f(g(x)).$$
NOTE: In general $f \circ g \neq g \circ f$, as can be seen in the next example.
Function composition.
Domain
The domain of $ (f \circ g)(x) = f(g(x))$ is the set of all $x$ such that $x$ is in the domain of $g(x)$, and $g(x)$ is in the domain of $f(x)$. To determine the domain of $(f\circ g)(x)$, you can use the following procedure.
Determine any values of $x$ in which $g(x)$ is undefined.
Determine any values of $x$ in which $f(g(x))$ is undefined.
The domain of $(f\circ g)(x)$ is the set of real numbers minus the union of the sets from steps 1. and 2.
Domain of composition, part 1.
Domain of composition, part 2.