I've been reading Jeffrey Lee's, Manifolds and Differential Geometry and John Lee's, Introduction to smooth manifolds.
In the first book (here, in page 31), after introducing partition of unity, there's an exercise that says:
Exercise 1.74. Show that if a function is smooth on an arbitrary set $S\subset M$ as defined earlier, then it has a smooth extension to an open set that contains $S$.
Where he says "as defined earlier", I assumed he meant that $M$ was paracompact, but maybe I missed something else.
On the sencond book (check here, in page 45) there's the Extension Lemma for Smooth Functions, and it says:
Lemma 2.26 (Extension Lemma for Smooth functions). Suppose $M$ is a smooth manifold with or without boundary, $A \subset M$ is a closed subset, and $f:A\to\Bbb R^k$ is a smooth function. For any open subset $U$ containing $A$, there exists a smooth function $\hat f:M\to\Bbb R^k$ such that $\hat f|_A=f$ and $supp(f) \subset U$.
And after proving the lemma there is this exercise that made me very confused.
Exercise 2.27. Give a counterexample to show that the conclusion of the extension lemma can be false if A is not closed.
Doesn't exercise 2.27 imply that exercise 1.74 is incorrect? Are those trick questions? Like when you are asked to prove something right but it turns out is not? Or, more likely, did I missed something in Jeffrey Lee's book?