Here is Prob. 11, Chap. 5 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition:
Suppose $f$ is defined in a neighborhood of $x$, and suppose $f^{\prime\prime}(x)$ exists. Show that $$ \lim_{h \to 0} \frac{ f(x+h)+f(x-h)-2f(x)}{h^2} = f^{\prime\prime}(x).$$ Show by an example that the limit may exist even if $f^{\prime\prime}(x)$ does not.
Hint: Use Theorem 5.13.
My Attempt:
As $f{\prime\prime}(x)$ exists, so there is an interval containing $x$ in which $f^\prime$ exists, and $f^\prime$ is continuous at $x$. [What if $x$ is an endpoint of the interval? How can we gaurantee that there is a segment containing $x$ on which $f^\prime$ exists? ] So there is an interval containing $x$ on which $f$ is defined and $f$ is continuous at $x$.
Therefore by Theorem 5.13 (i.e. L'Hospital's rule) in Baby Rudin, we obtain $$ \begin{align} \lim_{h \to 0} \frac{f(x+h) + f(x-h) -2f(x) }{h^2} &= \lim_{h \to 0} \frac{f^\prime(x+h) - f^\prime(x-h)}{2h} \\ & \ \ \ \mbox{ [ using L'Hospital's rule, } \\ & \ \ \ \ \ \ \mbox{ because $f(x+h)+f(x-h)-2f(x) \to 0$ and $h \to 0$ } \\ & \ \ \ \ \ \ \ \ \ \mbox{ as $h \to 0$ ]} \\ &= \lim_{h \to 0} \frac{ f^\prime(x+h) - f^\prime(x) + f^\prime(x) - f^\prime(x-h) }{2h} \\ &= \lim_{h\to 0} \frac{1}{2} \left( \frac{ f^\prime(x+h) - f^\prime(x) }{h} + \frac{ f^\prime(x-h)-f^\prime(x)}{-h} \right) \\ &= \lim_{h \to 0} \frac{1}{2} \left( \mathrm{R}f^{\prime\prime}(x) + \mathrm{L}f^{\prime\prime}(x) \right) \\ & \ \ \ \mbox{ [ Here $\mathrm{R}f^{\prime\prime}(x)$ denotes the right-hand derivative of $f$ } \\ & \ \ \ \ \ \ \mbox{ at $x$, and $\mathrm{L}f^{\prime\prime}(x)$ denotes the left-hand derivative; } \\ & \ \ \ \ \ \ \ \ \ \mbox{ we assume of course that here $h \to 0+$ ]} \\ &= f^{\prime\prime}(x). \end{align} $$
Is this reasoning correct?
Now let $f$ be the real function defined on $\mathbb{R}^1$ by $$ f(x) = \begin{cases} x^2 \sin \frac{1}{x} \ \mbox{ for $x \neq 0$} \\ 0 \ \mbox{ for $x = 0$}. \end{cases} $$ Then $$ \lim_{h \to 0} \frac{ f(h) + f(-h) - 2f(0) }{h^2} = \lim_{h \to 0} \frac{ f(h) - f(h) }{h^2} = 0, $$ but $$ \begin{align} f^{\prime\prime}(0) &= \lim_{h \to 0} \frac{ f^\prime(h) - f^\prime(0) }{h} \\ &= \lim_{h \to 0} \frac{ \left( 2h \sin \frac{1}{h} - \cos \frac{1}{h} \right) - 0 }{h} \\ &= \lim_{h \to 0} \left( 2 \sin \frac{1}{h} - \frac{\cos \frac{1}{h} }{h} \right), \end{align} $$ and the last limit (and hence $f^{\prime\prime}(0)$) of course does not exist.
Am I right?
However, as Rudin has not yet discussed the trigonometric functions (in a rigorous and systematic manner), I would like to have an example which is within the corpus of the examples dealt with by Rudin up to this point in the book.