Let $h$ be the periodic function with period $2$ such that $h(x)=2|x|$ if $|x|\le1$. Let 
$$f(x):=x+h(x)=x+2 \left| x-2 \left\lfloor \frac{x+1}{2}\right\rfloor \right| $$ for all real $x$. 
Here is a graph of $f$: 

[![enter image description here][1]][1]

Then the function $f$ is of degree $3$. However, if we had $f=P\circ g$ for some polynomial $P$ of degree $3$ and some increasing function $g$, then $f$ would switch at most twice on $\mathbb R$ from increasing to decreasing, or vice versa -- whereas $f$ actually has infinitely many such switches.  


  [1]: https://i.sstatic.net/yPleH.png