For example,
Is the function $h(x)=f(f(x))$ discontinuous at $x=0$ if $f(x)=\frac{1}{x}$ ?
My observation
$h(x)=x$ is continuous at $x=0$
$f(f(x))=\frac{1}{\frac{1}{x}}$ is discontinuous at $x=0$ as $f(x)=\frac{1}{x}$ is discontinuous at $x=0$.
The function $h(x)=x$ and $f(f(x))=\frac{1}{\frac{1}{x}}$ are not exactly the same. Thus, though $h(x)=x$ is continuous, when we say the composite function $f(f(x))=\frac{1}{\frac{1}{x}}=x$ we are already assuming the function is not defined at $x=0$, thus discontinuous at $x=0$.
Is my observation correct ?
Does this applies to similar composite functions, say $h(x)=f(g(x))$ where $f(x)=\frac{1}{x-1}$ and $g(x)=\frac{1}{x-2}$ ?
Similar Post
In a similar problem Discontinuity of composite function , I do not find any explanation rather than few comments arguing the continuity of function $\frac{1}{x}$ does not make sense at $x=0$ and it is a continuous function as the limit exists in its domain. But, check Example 5 clearly states "it is not a continuous function since its domain is not an interval. It has a single point of discontinuity, namely x = 0, and it has an infinite discontinuity there".
In all your examples, you consider functions that are not defined at some point. If $f$ is not defined at $x=0$, then $g\circ f$ is not defined at $x=0$ either and therefore not continuous at $x=0$.
In more generality, if $f$ is defined over all $\Bbb R$, but not continuous, it may very well be that $g\circ f$ is continuous: this happens for example if $g$ is constant - but of course this is not necessary.