Quote Originally Posted by FrozenDragoon View Post
But if we use the function f(x)=(1/2)x, then is the co-domain still [0,1]?
Yes, because any superset of the image of a function can be considered as its codomain. Image consists only of the values the function actually takes, but codomain can be larger. In this sense, domain and codomain are not symmetric concepts.

Quote Originally Posted by FrozenDragoon View Post
f(x) = \begin{cases} .5 & \text{if } 0\leq x < .5 \\ .3 & \text{if }.5\leq x \leq 1 \end{cases}
This works.