Can a cube of discontinuous function be continuous? Can a cube (meaning $g(x) = f(x)^3 = f(x) \cdot f(x) \cdot f(x)$) of discontinuous function $f: D \to \mathbb{R}$ ($D$ is subset of $\mathbb{R}$) be continuous? I think it can't, since $x^3$ is injective, but I am not able to prove it or find a counterexample.

Since $\phi :  \mathbb{R} \to  \mathbb{R}, \phi(x) = x^3$, is a homeomorphism, you see that $f$ is continuous iff $\phi \circ f$ is continuous.
