I need to analyse the frequency of a signal to see if it is at 100 Hz, my teach say that just measuring the frequency isn't enought. So I need to compare the phase with a reference signal of 100Hz to see if it is correct.

I want to know how can I produce a reference signal of 100 Hz with arduino and then compare its phase to the phase of a signal in entry ?

Then you need to compute an autocorrelation function Autocorrelation - Wikipedia to get the frequency and a cross correlation to get the phase shift with respect to the reference.

IMHO, the reason you need a phase, is to get better accuracy in specified period of time. Simple counting doesn't work well, on low freq., for example to get 10^-4 with 100Hz you need to count 100 sec. Look at this library: http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/ Input capture, that is what you need