I am new in Mathematica.
in matlab i define a function as: f(x)=x+1 then if i type f(2) answer is 3. how can i do this in mathematica.
It would be good for you to start to read the documentation and work through examples to learn the language. If you take the approach of trying to translate everything you know in Matlab into Mathematica that will take you a very long time to learn Mathematica in its own right and will cause you confusion at every turn.
Read the documentation. A good place to start to get an overview of things is here:
And a very good recent book to learn the language as a whole is the following:
In Mathematica, if you want to define a function, say x+y+z, we have to the following,
f[x_ , y_ ,z_] := x+y+z (shift+enter)
for further information, see documentation.