Q:

Smooth convex extensibility of combination of two line segments

This is a refined version of my earlier question Convex extensibility of combination of two lines.

Is there a smooth function $f:[0,1]\times [0,1]\rightarrow\mathbb R$ such
  that for all $x\in [0,1]$, $$ f(x,1)=x,\qquad f(x,0)=0, $$ and $f$ is convex or concave?

If yes, is there a "nice" example?

A:

A cheap convex solution on $\mathbb{R}^2$  is
$$f_0(x,y):= \big(x+3y-2\big)_+ -y \, ,$$
which also verifies $f_0(x,y)=-y$ for all $(x,y)$ in the rectangle   $$[-1/4, 5/4]\times [-1/4,1/4]=\big([0,1]\times\{0 \}\big)\;{\bf +}\; [-1/4,1/4]^2 \subset\{x+3y-2\le0\} \, , $$ 
and $f_0(x,y)=x+2(y-1)$ in the rectangle   $$[-1/4, 5/4]\times [3/4,5/4]=\big([0,1]\times\{1 \}\big)\big)\;{\bf +}\; [-1/4,1/4]^2 \subset\{x+3y-2\ge0\} \, .$$ As a consequence,  if $\phi$ is a symmetric $C^\infty$ convolution kernel with support in $[-1/4,1/4]^2$, the function $f:=f_0*\phi$ is a $C^\infty$ convex function on $\mathbb{R}^2$ satisfying $f(x,0)=0$ and $f(x,1)=x$. 
(We can take e.g. $\phi(x,y):=\psi(x)\psi(y)$ with $\psi\in C^\infty(\mathbb{R})$, $\psi\ge0$, $\psi(-t)=\psi(t)$, $\operatorname{supp}(\psi)\subset[-1/4,1/4]$, $\int_\mathbb{R}\psi(t)dt=1$ ).
For a concave $C^\infty$ solution, the same construction works with $$f_0(x,y):=2y-\big(3y-x-1\big)_+\;    $$
and in fact it can be adapted to a more general situation, as the main point of it is just, that  convolution with a non-negative mollifier with compact support preserves convexity, and also fixes any affine function, if the mollifier is symmetric (meaning  $\phi(x)=-\phi(x)$ for all $x$).

