Given the function $F(x)=\begin{cases} 1 & x\leq 1; \\ f(x) & 1\leq x\leq 3; \\ 2x^2 & 3\leq x.\end{cases}$
I would like to know if there is a general method to find $f$ convex such that $F$ is $C^2$. I directly tried to interpolate with $f$ a polynomial of degree 5 such that $f(1)=1,f'(1)=f''(1)=0$ and $f(3)=18,f'(3)=12,f''(3)=4$. The problem is that $f''(x)\not\geq 0,\forall 1\leq x\leq 3$.
The 7th-degree polynomial $$ \begin{split} \phi(x) &= \frac{2}{5} x^7 - \frac{13}{2} x^6 + \frac{3551}{80} x^5 - \frac{6547}{40} x^4 \\ &\quad + \frac{13899}{40} x^3 - \frac{8303}{20} x^2 + \frac{20547}{80} x - \frac{2511}{40} \end{split} $$ should do the job.
Here is a plot of the $C^2$ function $F$:
and its continuous nonnegative second derivative $F''$:
Curiously, there is no 6th-degree polynomial interpolation satisfying the given constraints as suggested by Robert Shore's comment.
Suppose that we try a 6th-degree polynomial $$ \phi(x) = a x^6 + b x^5 + c x^4 + d x^3 + e x^2 + f x + g. $$ The constraints \begin{align*} \phi(1) &= 1, \\ \phi'(1) &= 0, \\ \phi''(1) &= 0, \\ \phi(3) &= 18, \\ \phi'(3) &= 12, \\ \phi''(3) &= 4 \end{align*} translate to \begin{align*} a+b+c+d+e+f+g&=1 \\ 6 a+5 b+4 c+3 d+2 e+f&=0, \\ 30 a+20 b+12 c+6 d+2 e&=0, \\ 729 a+243 b+81 c+27 d+9 e+3 f+g&=18, \\ 1458 a+405 b+108 c+27 d+6 e+f&=12, \\ 2430 a+540 b+108 c+18 d+2 e&=4, \end{align*} whose solution is \begin{align*} b &= \frac{1}{16} (19-192 a), \\ c &= \frac{3}{8} (152 a-33), \\ d &= \frac{1}{8} (383-1088 a), \\ e &= \frac{1}{4} (684 a-325), \\ f &= \frac{27}{16} (37 - 64 a), \\ g &= \frac{27}{8} (8 a-5). \\ \end{align*} Additionally, we need to satisfy the convexity constraint $$ \phi''(x) > 0 \qquad \text{ for all } 1 < x < 3, $$ where $$ \begin{split} \phi''(x) &= 30 a x^4+20 b x^3+12 c x^2+6 d x+2 e \\ &= 30 a x^4+\frac{5}{4} (19-192 a) x^3 \\ &\quad +\frac{9}{2} (152 a-33) x^2 + \frac{3}{4} (383-1088 a) x+\frac{1}{2} (684 a-325). \end{split} $$ This is where things go awry. By inspecting the two particular points $$ \phi'' \biggl( \frac{10}{9} \biggr) = -\frac{2 (4063 a-6465)}{2187} $$ and $$ \phi'' \biggl( \frac{22}{9} \biggr) = \frac{13 (10 a-129)}{2187}, $$ we see that we need both $$ a < \frac{6465}{4063} < 2 $$ and $$ a > \frac{129}{10} > 12, $$ which is not possible.
Fortunately, a similar process and some trial and error successfully found the 7th-degree polynomial listed at the top of this answer.