## defining of the function (Mathematica)

Hi,

I'm trying to define in Mathematica (v 7.0) function such like this:

And when I'm testing it, all works:

g[2/3]

1

But if I add more conditions using 'Head', as follows: