TITLE: Lagrange Taylor remainder: can we choose $t^*$ continuously?
QUESTION [6 upvotes]: The Taylor theorem with Lagrange remainder tells us that for $f: \mathbb{R}^n \to \mathbb{R}$ twice differentiable (we can assume $C^2$ if we like), 
$$f(y) - f(x) =  \left\langle \nabla f(x), y-x \right\rangle + \frac12 \left\langle \nabla^2f(x^*)(y-x), y-x\right\rangle$$
for $x^* $ strictly between $x$ and $y$. My question is, is it always possible to choose $x^*$ continuously as $y\to x$ (along the straight line from $y$ to $x$, let's say to start)? The question reduces to the 1d case if we just look at $f(x+t(y-x))$.

REPLY [5 votes]: The answer is negative. (By the way, your Taylor expansion is missing $\frac12$ at the quadratic term). Let's reduce the problem to one dimension, as you suggested. We can also simplify things by taking $x=f(x)=f'(x)=0$ (this amounts to shifting coordinates and subtracting a linear function from $f$). Now 
$$f(y) = \frac12 f''(x^*) y^2 \tag{1}$$
and the question is, can $x^*$ be chosen continuously as a function of $y$, so that 
$$f''(x^*) = 2 f(y)/y^2 \tag{2}$$
holds? Yes if $f''$ has a continuous inverse, but not in general: for example, we are in trouble if the graph of $f''$ has a flat spot. Here is a concrete counterexample: 
$$f(x)= \begin{cases} x^3,\quad & x<1 \\ 3x^2-3x+1, \quad & 1\le x\le 2 \\ x^3-3x^2+9x-7,\quad & x>2\end{cases}$$

This function is $C^2$ smooth, with 
$$f''(x)= \begin{cases} 6x,\quad & x<1 \\ 6, \quad & 1\le x\le 2 \\ 6x-6,\quad & x>2\end{cases}$$
When $2f(y)/y^2<6$, we have $x^*<1$; when $2f(y)/y^2<6$, we have $x^*>2$. Thus, there is a discontinuity at $y$ such that $2f(y)/y^2=6$. It's clear that such $y$ exists since $f(y)/y^2 \to \infty$ as $y\to \infty$. Specifically, $y\approx 4.279$.