Given functions $f, g,$ and $h$ on some smooth manifold M such that $f \circ g$ and $g \circ h$ are $C^\infty$, must $f\circ g\circ h$ be $C^\infty$?
I can't imagine this is true, but I'm having trouble coming up with a counterexample. I've also had no luck in coming up with a proof, but I haven't been focusing on it for too long.