Constructing a function similar to x^3 between [0,1] I'm trying to construct a function $f$, in order to normalize a dataset(obviously where all the element come from $[0,1] \in \mathbb{R}$. 
The big picture is that the envisioned $f: [0,1] \rightarrow [0,1]$ pushes the values that fall to the right side of the initial average of the dataset to $1$, and similarly the values that fall to the left side of the average to $0$. But I want the function to act on the relatively very big and very small numbers in a stronger manner.
So basically the function will look similar to $x^3$'s general pattern. Additionally I'd like to fix some values as follows:


*

*f(0) = 0,

*f(1) = 1,

*f(avg) = avg, where avg stand for the average of the initial dataset.


Currently I'm having problem with fixing the endpoints. For instance $(x-avg)^3+avg$ would get me $f(avg)=avg$ but not the other two.
I open to using some other formula as long as it adheres to my desired properties.
Please let me know if something regarding the problem description is not clear.
 A: I'm not sure how to make a cubic push outliers to the "side" but I think a cubic satisfying the 3 stipulations you put on $f$ is possible. I will need $3$ parameters to work with since you place $3$ conditions. Suppose $f(x)=x^{3}+bx^{2}+cx+d$ which is a function with general cubic behaviour. Then $f(0)=0$ implies that $d=0$. $f(1)=1$ implies that $b+c=0$. With these stipulations our function must already take the form:
$$f(x)=x^{3}+bx^{2}-bx$$
Now if we also demand that $f$ fixes a point then we require for some $x$ that:
$x=f(x)=x^{3}+bx^{2}-bx$ so $0=x(x^{2}+bx-(1+b))$
So we must require $x^{2}+bx-(1+b)=0$. This amounts to requiring that:
$b(x-1)=1-x^{2}$ so $b=-1-x$ (This works provided that avg$\,\neq1$. Note that if avg$\,=1$ then $f(1)=1$ deals with this so $b$ is free.). Taking $x=avg$ then we have that $f(x)=x^{3}+(-1-avg)x^{2}-(-1-avg)x$. This gives a cubic type function with the desired properties.
A: If I understand correctly, for $x$ between 0 and $avg$ you want $f(x)$ to be closer to 0 than $x$ is. In that case,  I would think you want the function to have the general character of $x^{1/3}$ rather than $x^3$, which will pull points toward the center. For instance if $avg = 1/2$, it seems like you'd want something like $f(x)=(x/5-1/10)^{1/3}+1/2$. The vertical scale isn't quite right, but I see you've already accepted another answer, so I'm going to let this go for now. But if you want to push points toward the endpoints and want the effect to be stronger for values farther from avg, I don't think any simple, s-shaped function will do it.
