Looking for a specific differentiable function I'm from computer science and not a mathematician, so i hope you can help me by finding a function with the following properties:
In principle it is about the following function:
  \begin{equation}
    f(x)=
    \begin{cases}
      x^2,\; if \; x < 0 \\
      x,  \;if \; x > 0
    \end{cases}
  \end{equation}
so something like this: 1
My problem is that i need a continuous and differentiable function, which doesn't have to be perfect, but should approximate this function. The obligatory properties are:
   \begin{equation} f(0) = 0 \end{equation}
\begin{equation} \min f(x) = 0 \end{equation}
\begin{equation} if \; x < 0 \rightarrow  f(x) \approx x^2 \end{equation}
\begin{equation} if \; x > 0 \rightarrow  f(x) \approx x \end{equation}
and function must be continuous and differentiable everywhere.
It would be best, of course, if there were any possibility to approximate such a function, regardless of which function I want to have on the left and which I want to have on the right side, of the y-axis, as long as it meets all the requirements described above. So, for example also two quadratic function but with  different exponents on both sides. But i don't think that such an general solution is possible ...
 A: Let $s_h(x): \mathbb{R} \to (0;1)$ be the sigmoid function with parameter $h$:
$$
s_h(x) = \frac{1}{1 + e^{-hx+20}}
$$
Note that $\lim_{x \to - \infty} s_h(x) = 0$ and $\lim_{x \to + \infty} s_h(x) = 1$ and that $f(x)$ can be extended to be continuous for $x=0$ by choosing $f(0)=0$.
A possible function $g_h$ can be:
$$
g_h(x) = (1 - s_h(x)) x^2 + s_h(x) x
$$
Larger values of the parameter $h$ will lead to a narrower sigmoid function, meaning a narrower transition between $x^2$ and $x$.

Edit: I changed the formula for $s_h$ (and added a missing minus sign in there). This way, the derivative $g'(0)$ is close to zero.

Edit2: I got a better one:
Let $r_h(x): \mathbb{R} \to (0;1)$ be the sigmoid function with parameter $h$:
$$
r_h(x) = 1 + \frac{1}{1 + e^{hx}}
$$
Note that $\lim_{x \to - \infty} r_h(x) = 2$ and $\lim_{x \to + \infty} r_h(x) = 1$.
A possible function $y_h$ can be:
$$
y_h(x) = |x|^{r_h(x)}
$$
that has a minimum for $x=0$, $y_h(0)=0$.
A: Both sides must have derivative $0$ at the origin to guarantee differentiability at the origin. I think that means there's no way to avoid a corner there if $f(x) \approx x$ on the right.
You could try
$$
    f(x)=
    \begin{cases}
      |x|^\alpha&   x < 0 \\
      x^\beta  &  x > 0
    \end{cases}
$$
for any $\alpha$, $\beta > 1$ .
Here is a picture with $\alpha = 2.5$, $\beta = 1.2$. The second graph shows a magnification near the origin. The more you enlarge it there the more you see that there is no corner.

