The traditional way is to use Gessel's test. N is a Fibonacci number if and only if 5N2 + 4 or 5N2 – 4 is a square number. This is discussed in this SO question and this SO question. You can also find examples here, but this page has code on Python (though it's easy to understand).
Now, if you were asked to use recursion specifically... Well one way is just so start generating Fibonacci numbers until the generated number becomes more or equal to the number you are testing. If there is a match, the tested number belongs to Fibonacci sequence. If there is no match, and you have generated a number greater than the tested one, then the tested number is not a Fibonacci number.
Here is a basic (and ugly) example for you:
bool isFibonacci( int testedNumber, int a = 1, int b = 1 )
{
if( testedNumber == 0 || testedNumber == 1 )
return true;//returning true for 0 and 1 right away.
int nextFib = a + b;//getting the next number in the sequence
if( nextFib > testedNumber )
return false;//if we have passed the tested number, it's not in the sequence
else if( nextFib == testedNumber )
return true;//if we have a perfect match, the tested number is in the sequence
else
isFibonacci( testedNumber, b, nextFib );//otherwise, get the next fibonacci number and repeat.
}
Use it just as isFibonacci( the_number_you_want_to_test );
Note that Fibonacci numbers can be calculated in O(log n)
time, as described for example in this SO question.