I need to define a function f(x) so that:
f(x) = 0, when x=0
=1, when x >0
while, x >=0 and integer only
NWell, you have defined it! You've told us exactly what its domain of definition is, and what its value is for every element of the domain. Do you want a name for it (it's a step function or Heaviside function or sign function or signum) or are you trying to express it as an algebraic formula of some kind?