Can I apply Whitney's extension theorem to arbitrary smooth functions? Whitney's extension theorem (e.g. Narasimhan's Analysis on Real and Complex Manifolds, p.31) states the following. 

Suppose $X$ is a closed subset of an open set $\Omega \subset \mathbb{R}^n$. Choose an integer $k>0$. Suppose that for every multi-index $\alpha$ with $|\alpha|\le k$, we have a continuous function $f_\alpha\in C^0(X)$. Then there is a function $F \in C^k(\Omega)$ satisfying $D^\alpha F|_X=f_\alpha$ if and only if for every $\alpha$, we have
  $$f_\alpha(x) = \sum_{|\beta|\le k-|\alpha|} f_{\alpha+\beta}(y)(x-y)^\beta + o(|x-y|^{k-|\alpha|}),$$
  uniformly on compact subsets of $X$ as $|x-y|\to 0$. 

I think that implies that given $f \in C^k(X)$, we can extend $f$ to $F \in C^k(\Omega)$ satisfying $F|_X=f$, since the Taylor expansion of $f$ satisfies the above condition. Is this correct?
EDIT: For context, I was considering the case where $X=\overline{G}$ for some open set $G$. I had $f \in C^k(\overline{G})$ from an embedding theorem. The accepted answer applies equally well in my setting: $C^k(\overline{G})$ was defined for my embedding theorem the way @Jack Lee's answer described. 
 A: Here's the trouble with your suggested formulation: What do you mean by the hypothesis $f\in C^k(X)$? For a function to be of class $C^k$ in the usual sense, all of its partial derivatives up to order $k$ must first of all exist. But if $X$ is not open, then the values of $f$ that appear in the difference quotient for $\partial f/\partial x^i$ might not even be defined.  (Just think of trying to apply $\partial/\partial x$ to a function defined only on the $y$-axis in the plane.)
Nonetheless, there is a standard definition of what it means for a function to be of class $C^k$ on a nonopen subset $X\subseteq\mathbb R^n$: We say $f\in C^k(X)$ if for each $p\in X$, there is an open set $U\subseteq\mathbb R^n$ containing $p$ and a function $g\in C^k(U)$ such that $g|_{U\cap X} = f|_{U\cap X}$. If $X$ is closed in $\Omega$ and $f\in C^k(X)$ with this definition, then you can use a partition of unity to blend together the local $C^k$ extensions fo obtain a global function $F\in C^k(\Omega)$ such that $F|_X = f$. But the proof of that result doesn't require Whitney's extension theorem -- it's just a simple application of the existence of partitions of unity. (You can find a proof of the $C^\infty$ case in my book Introduction to Smooth Manifolds, Lemma 2.26, and the same proof generalizes immediately to the $C^k$ case. That lemma actually proves a little bit more, namely that you can choose $F$ to be supported in any predetermined neighborhood of $X$.)
