Definition of smooth function on a manifold I have a question about the definition of smooth function defined on a manifold, as described in An Introduction to Manifolds by Loring W. Tu. In the book is the following definition:

So if we set $M=\Re$, $p=0$ and $U=(-1, 1)$. Pick $f = x/2$ when $x \lt 0$, $f = x$ when $x \ge 0$. Then if we define $\phi = f$, we obtain $f \circ \phi^{-1}= 1$. I believe the choice of $\phi$ is valid, as is a homeomorphism.
According to the definition, since $f \circ \phi^{-1}$ is smooth, then $f$ is smooth. But clearly $f$ is not smooth!
Please can someone clarify where my understanding is wrong?
===
Edit: an error in my original question, I have made a change such that now we have $\phi=f$, which yields $f \circ \phi^{-1}=1$, as required. (Previously I had $\phi=f^{-1}$). This doesn’t change the nature of the question, but felt I should explain as obviously will affect the reading of any answers given. Answers have now been provided, and thanks all for helping.
 A: Your question is very similar to Confusion regarding compatible charts on smooth manifolds.
You are confused by the word chart. In § 5.1 Tu introduces the concept of a topological $n$-manifold $M$ and defines a chart on $M$ to be any pair $(U,\phi)$, where $U \subset M$ is open an $\phi : U \to V$ is a homeomorphism onto an open $V \subset \mathbb R^n$. For the sake of precision let us call this a topological chart on $M$.
In § 5.3 he introduces the concept of a smooth $n$-manifold. This is a topological manifold $M$ together with a differentiable structure. The latter is a maximal atlas $\mathfrak D$ with $C^\infty$-transition functions between all charts in $\mathfrak D$. At the end of § 5.3 Tu explicitly says

From now on, a “manifold” will mean a $C^\infty$ manifold. We use the terms “smooth” and “$C^\infty$” interchangeably. [...] By a chart $(U,\phi)$ about $p$ in a manifold $M$, we will mean a chart in the differentiable structure of $M$ such that $p \in U$.

Of course there are many more topological charts on  $M$, but if such a chart does not belong to differentiable structure, then Tu does not use it.
This is what you do: Your chart $\phi = f$ is a topological chart not belonging to the standard differentiable structure of $\mathbb R$. You can use this chart to endow $\mathbb R$ with a non-standard differentiable structure, and with respect to it the map $f$ is smooth.
See also In smooth atlases, are the identity homeomorphisms "supersets" for all other homeomorphisms on the smooth structure? and On the confusion of $C^{\infty}-$maps between manifolds and differentiable maps..
