Let $I$ be an interval in $\Bbb{R}$ and $f, g : I\to \Bbb{R}$ such that $f$ is continuous and $g$ is discontinuous.
Question: Can either of $f\circ g$ or $g\circ f$ be continuous?
Let $I$ be an interval in $\Bbb{R}$ and $f, g : I\to \Bbb{R}$ such that $f$ is continuous and $g$ is discontinuous.
Question: Can either of $f\circ g$ or $g\circ f$ be continuous?
Yes. Take $I=\mathbb{R}$, $f\equiv 0$, $g$ is Dirichlet function. Both $f\circ g$ and $g\circ f$ are continuous in that case.
Here is a simple example.
Take
for function $f$ the continuous "absolute value" function,
for function $g$ the discontinuous function (curve represented in red on the figure below) defined by :
$$g(x)=\begin{cases}-x-1&\text{if} \ -1 \leq x < 0\\ -x+1&\text{if} \ \ \ 0 \leq x \leq 1\\ 0&\text{elsewhere}\\ \end{cases} ;$$
$g$ is a discontinuous function .
Then
$$(f \circ g)(x)=(g \circ f)(x)=t(x)$$
where $t$ is the continuous so-called "tent" function (blue curve on the figure).
Similar question : Composition of a continuous function and a discontinuous function, can be continous..