Combination of continuous and discontinuous functions

I know that combining two continuous functions gives a continuous function, i.e., if $f(x)$ and $g(x)$ are continuous, then $f(x)\pm g(x)$, $f(x)\times g(x)$ and $f(x)\div g(x)$ are continuous provided $g(x)\neq 0$. But what if $f(x)$ is continuous and $g(x)$ are discontinuous and we want to determine what type of function $f(x)\times g(x)$ is.
I have tried something out to prove that it will be discontinuous.

Let $h(x)=f(x)\times g(x)$.
Thus, $g(x)=\frac{h(x)}{f(x)}$, where $f(x)\neq 0$

If $h(x)$ is continuous, then $g(x)$ is also continuous. But this is contrary to our assumption.

So, $h(x)$ must be discontinuous.
So, $f(x)\times g(x)$ must be discontinuous.

This is alright but when I asked my teacher he said that the multiplication can yield both sort of functions, continuous and discontinuous. So, what have I missed in my derivation? Should I have considered something else as well or was my conclusion wrong?


You have proven that if $f(x)\neq 0$ and $g$ is not continuous, then $f(x)\cdot g(x)$ is not continuous. Your proof is correct.

However, if $f(x)$ can be allowed to have zero values, all bets are off. For example, if $f(x)=0$ for all values of $x$, then $f\cdot g$ will be continuous no matter what the function $g$ is.


You remark in your proof that $f(x)\neq 0$, but it's perfectly reasonable that $f(x)=0$.


Well! Its not necessary that one of the functions must be zero. For ex- take |x| as f(x) and sgn(x) as g(x). Now their product is |x|sgn(x) which is continuous. U can check its continuity on 0 as its the only suspicious point. And their left hand side limit and right hand side limit will come same.