The derivative has to be zero at 3 points, and at one of them, it has to have a double zero to get that saddle point. This is a total of 4 zeros for the derivative, meaning it has to be a fourth order polynomial where the zeros are at known locations, meaning I can write it as:
$$
f'(x) = (x-x_1)(x-x_2)(x-x_3)^2,
$$
where $x_1$ is the max point, $x_2$ is the min point, and $x_3$ is the saddle point. You can plug in some some concrete values and get a form for $f'$, then integrate. So the most general formula for your curve is
$$
f(x) = \int(x-x_1)(x-x_2)(x-x_3)^2\;dx
$$
I used some concrete values ($x_1=1/8,\;x_2=1/2,\;x_3=1$) and got
$$
f(x) = 1/16 x - 3/8 x^2 + 37/48 x^3 - 21/32 x^4 + x^5/5
$$
Take a look here so you can put in your own values if you want and get the polynomial coefficients for LaTeX use.
EDIT
If you really want that the function must be zero and have zero derivative at $x_2$, then you can begin as mentioned in the comments, and add in an offset:
$$
g(x) = f(x) - f(1/2)
$$
So clearly $g(1/2)=0$, but now $g(0)\neq 0$. However, we can just move the curve to the right by the correct amount now to get the curve to go through the origin. This requires finding where $g(x_4)=0$ (a small shift in this problem of about $x_4=-0.01346503$, this has a closed form in terms of radicals), but once we have that, we form a shifted function
$$
h(x) = g(x+x_4).
$$
The function $h$ satisfies all the requirements, as you can see through the links below. If you want the final, exact coefficients, they are really messy (here). You can also get approximate coefficients using the decimal approximation above. With the approximation, $h(0)\approx 10^{-10}$ which isn't exactly zero, but it is graphically indistinguishable from zero for your plot.
$f'(x)=A(x-3)(x-5)=A(x^2-8x+15)$ for some constant $A$.
$f(x)=A\left(\dfrac{x^3}3-4x^2+15x\right)+k$ for some constant $k$.
Since $f(3)=3$ and $f(5)=1$, $3=18A+k$ and $1=\dfrac{50}3A+k$.
Solving, $A=\dfrac32$ and $k=-24$.
$f(x)=\dfrac12x^3-6x^2+\dfrac{45}2x-24$.
Note that $f''(x)=3x-12$.
$f''(4)=0$ and $f(4)=2$.
Best Answer
An inflection point at (0,18) gives two equations:
$f''(0) = 0$ and $f(0)=18$.
The critical point gives rise to the equation $f'(2)=0$ and you have $f(2)=2$. Then you have four linear equations in four unknowns, which you can solve by substitution.