From the discontinuity of $f(x)$ and $g(x)$, can we directly tell about the discontinuity of $f(g(x))$?
I thought $f(g(x))$ would be discontinuous where $g(x)$ is discontinuous and where $g(x)=c$, where $c$ is the point of discontinuity of $f(x)$.
But this is not true. e.g.
$$f(x)=\begin{cases}1-x,&0\le x\le1\\x+2,&1\lt x\lt2\\4-x,&2\le x\le4\end{cases}$$
$f(x)$ is discontinuous at $x=1$. As per my theory above, $f(f(x))$ should also be discontinuous at $x=1$. But this is not true.
But that theory is applicable on the following set of functions.
$f(x)=|2x-1|+|2x+1|$ and $g(x)$ being the fractional part of $x$.
Both $g(x)$ and $f(g(x))$ are discontinuous at $x=0$.
Can we generalize the above theory so that it captures all the cases?
Composition can mix things up rather weirdly. I'd be surprised if there is any good "theory" at all.
Here is an example to ponder. Consider a real number $c \in \mathbb R$ and a partition of $\mathbb R$ into three subsets $\mathbb R = A \sqcup B \sqcup C$ such that $B=A+c=\{x+c \mid x \in A\}$ and such that $A,B,C$ are all dense. For example we can take $A = \mathbb Q$ and $B=\mathbb Q+\sqrt{2}$ and $C=\mathbb R - \bigl(\mathbb Q \cup (\mathbb Q + \sqrt{2})\bigr)$.
Define $$f(x) = \begin{cases} x + c & \text{if $x \in A$} \\ x - c &\text{if $x \in B=A+c$} \\ x & \text{if $x \in C = \mathbb R - (A \cup B)$} \end{cases} $$ Notice that $f$ is discontinuous at every point.
Now let $g(x)=f(x)$. Still discontinuous at every point.
Finally, note that $f(g(x))=x$, which is continuous at every point.