Examples of $C^2(0,1)\cap C[0,1]$ I need examples of $C^2(0,1)\cap C[0,1]$. Are $x^2$ and $e^x$ examples. What is the importance of the closed interval $[0,1]$?
 A: If by $u\in C^2(0,1)\cap C[0,1]$ you mean that $u:[0,1]\to\mathbb{R}$ is continuous and $u$ restricted to the interval $(0,1)$ is $C^2$, then you can consider the function $u$ defined by $$u(x)=\sqrt{\frac{1}{4}-\left(x-\frac{1}{2}\right)^2}$$
Note that $u$ is not in $C^2[0,1]$.
In partial differential equations it is common to see the space  $ C^2(0,1)\cap C[0,1]$. For example, in trying to solve the equation (for suitables $f$ and $g$) 
$$\tag{1}
 \left\{ \begin{array}{rl}
 \Delta u=f &\mbox{ in $(0,1)$} \\
  u=g &\mbox{ in $\partial(0,1)$}
       \end{array} \right.
$$
a natural space to look for solutions is: $C^2(0,1)\cap C[0,1]$. This happens because we need two derivatives for the laplacian and if $g$ has some regularity on the boundary, we would expect that also $u$ has some regularity near the boundary (for example it is continuous).
A: You can consider the function $x \, \mapsto \, x \sin(\frac{1}{x})$ which is continuous on $[0,1]$ and $\mathcal{C}^{2}$ on $]0,1[$.
Edit : (explanations)

The function $x \, \mapsto \, x \sin(\frac{1}{x})$ is $\mathcal{C}^{2}$ on $]0,1[$ since it is the composition and product of functions which are $\mathcal{C}^{2}$ on $]0,1[$.
From the inequality $\vert x \sin(\frac{1}{x}) \vert \leq \vert x \vert$, we deduce that $\lim \limits_{x \rightarrow 0} x \sin(\frac{1}{x}) = 0$. The function $x \, \mapsto \, x\sin(\frac{1}{x})$ which is defined on $]0,1]$ can be defined on $[0,1]$ by letting :
$$
f(x)=
\begin{cases}
x \sin(\frac{1}{x}) & \text{if } x \neq 0 \\
0 & \text{if } x =0 \\
\end{cases}
$$
The function $f$ is continuous on $[0,1]$. But the derivative of $f$ at $x=0$ doesn't exist. Consider $\frac{f(x)}{x}$ : we have
$$ \frac{f(x)}{x} = \sin(\frac{1}{x}) $$
$\sin(\frac{1}{x})$ does not converge as $x \rightarrow 0$. So $f$ is not differentiable at $x=0$.

A: All polynomials, $\exp$, $\cos$, $\sin$ are in $C^\infty\left(\Bbb R\right)$. Also, for $f,g \in C^\infty\left(\Bbb R\right)$, $f+g\in C^\infty\left(\Bbb R\right)$, $fg\in C^\infty\left(\Bbb R\right)$ and $f\circ g \in C^\infty\left(\Bbb R\right)$. Then, you can restrict those functions to $[0,1]$ to get functions that are in $C^\infty[0,1]$ and whose restriction to $(0,1)$ are in $C^\infty(0,1)$ and therefore are examples of such functions.

To understand why having less smoothness on the slightly bigger interval is interesting, let's look at properties of functions $f:[0,1]\to \Bbb R$ so that $f$ is $C^0$ on $[0,1]$ and $C^1$ on $(0,1)$ but $f$ is not $C^1$ on $[0,1]$. Since $f'$ is $C^0$ on $(0,1)$, we would be able to make $f$ $C^1$ on $(0,1)$ if we could extend $f'$ by continuity. Since we can't, at least one of the limits between $\lim\limits_{x\to 0}f'(x)$ and $\lim\limits_{x\to 1}f'(x)$ does not exist. A classic example of such a function is $x\mapsto x\sin\frac{1}{x}$. The idea here is that when you differentiate it, you'll get a $\sin\frac{1}{x}$ term because of the product rule and it won't converge near $0$ since it won't have the $x$ factor to drag it towards $0$.

The one thing here you should remember is the example $x\mapsto x\sin\frac{1}{x}$ which helps to understand the necessity of most of the seemingly useless hypothesis of current real analysis theorems.
