The result of evaluating a Wolfram Language function may be the same as the input if the function is called with the wrong types of arguments. You can replicate that behavior in user-defined functions.

Using Argument Patterns...

If you invoke a function with arguments that do not match the argument patterns in its definition, it will return unevaluated.

Define f to take an integer argument:

In[1]:=
Click for copyable input

f evaluates when it is called with an integer:

In[2]:=
Click for copyable input
Out[2]=

f returns unevaluated when it is called with a noninteger:

In[3]:=
Click for copyable input
Out[3]=

Using Conditional Tests...

If you add a condition to a function definition, the function will return unevaluated if the condition is not satisfied.

Define g to evaluate only if its argument is odd:

In[4]:=
Click for copyable input

g evaluates when it is called with an odd integer:

In[5]:=
Click for copyable input
Out[5]=

g returns unevaluated when it is called with an even integer:

In[6]:=
Click for copyable input
Out[6]=