Considering the function $f(x)= \begin{cases} x+ x^2 \sin \frac{1}{x} \mbox{ if } x \neq 0 \\ 0 \mbox{ if } x=0 \end{cases},$ show that the hypothesis: $f'$ is continuous can not be removed from inverse function theorem.
I have tried in the following way:
IFT says that : If $f: \mathbb{R}^n \rightarrow \mathbb{R}^n$ is a continuously differentiable function in an open set containing $a$ and $\det f'(a)=0.$ Then there is an open set $V$ containing $a$ and an open set $W$ containing $f(a)$ such that $f: V \rightarrow W$ has a continuous inverse $f^{-1}$ which is differentiable and $(f^{-1})'(y)=\frac{1}{f'(f^{-1}(y))}$ for all $y$ in $W.$
Clearly, $f'(x)=\begin{cases} 1+2x\sin \frac{1}{x}-\cos \frac{1}{x} \mbox{ if } x \neq 0\\ 1 \mbox{ if } x=0 \end{cases}.$ Now $f'(1/2 n \pi)=0$ for all $n \geq 0.$ Hence this contradict the existance of $(f^{-1})'$ near $0.$
Am I correct?
Your calculation of $f'(x)$ when $x\neq 0$ is incorrect.
You have differentiated a piecewise function by differentiating each piece; this is not always valid. The derivative is a limit and so its value at boundary points of the piecewise definition (here this would be $x=0$) is affected by both pieces.
More specifically: what happens to the derivative you calculated for $x\neq 0$ when you approach $0$?