Motivated by this question I wish to pose the following question:
Given $k$ points $(x_1, y_1), \ldots (x_k, y_k)$ with (WLOG) $x_i < x_{i+1}$, can we find a polynomial $p(x)\in\Bbb R[x]$ satisfying
- $p(x_i) = y_i$
- $p'(x_i) = 0$
- For $x_1 < x < x_k$ we have $p'(x) = 0 \iff x\in \{x_1, \ldots, x_k\}$
Note the key difference with the linked problem in that we do not demand all of the critical points and values be prescribed, indeed the polynomial may have as many as we wish, and possibly a bunch of non-real roots. We simply demand that we know all of the real roots on some interval $[x_1, x_k]$. I am also willing to grant that $y_i=y_j\implies i = j$ carte blanche in the setup, as this was an issue in the original problem.
A "stretch goal" of sorts is that in an ideal world we would also have some control over the nature of the critical points, eg. prescribe a condition such as $p'(x_i)p'(x_{i+1})<0$ or possibly even greater control.
What does it all mean? This would answer one of the so-called "calculus superstition" problems undergraduates often have, i.e. any snippet of a random graph is secretly a polynomial graph, we teaching them are just making them suffer needlessly.
One approach is to start with $p_0(x)$ determined by the derivative criteria, using basic calculus to produce $P_0(x)$ satisfying our second condition, and choosing a primitive so that say $p(x_1)=y_1$. Now if we scale $p_0$ in addition, we can make it so $p(x_2) = y_2$ as well if needed, as we might as well consider $x_1=0$ by a variable shift, if necessary. But for $3$ or more points, this approach no longer works.
One is tempted to attempt the following construction in the case no $y_i =0$ (which I'm willing to grant for the time being as this won't even work in the special case):
Construct $P_0(x)$ as before, and consider $A(x)$ so that $A(x_i) = y_i / P_0(x_i)$, so that $P_1(x) = A(x_i)P_0(x_i) = y_i$. We immediately run into a problem though as here $P_1'(x) = A'(x)P_0(x) + A(x)P_0'(x)$ which makes this problem self-referential: we'd need to be able to construct $A(x)$ with the same critical points and it's own values there prescribed.
For my part I'm not sure I believe such a thing exists, but unlike the original problem the freedom in degree frees up a lot of wiggle room. The only answer to the linked question given (at the time of this posting) is Alexandre Eremenko's and of course those familiar with interpolation recognize its truth and that the two free parameters mean one could prescribe all of one and $2$ of the other with a given degree, but it's not clear to me (possibly because I am missing something quite obvious) that with no degree bound doesn't make the modified version of the problem work.