I need a function that returns $0$ if the given number is negative, and otherwise doesn't change the number.
Example: $$y(-5)=0,\ y(-2)=0,\ y(0)=0,\ y(3)=3,\ y(2566)=2566.$$
Does such a function exist?
You can take for example $$\frac{|x|+x}{2}.$$ You can construct similar examples.