1. You can easily detect the frequency by measuring the time between two (or more for greater accuracy) consecutive positive transitions. Or by counting pulses in a set time period (the greater the period, the greater the accuracy).

2. Assuming just a Digital I/O is available to you (such as with a 16F84), the ON period TIME will differ for SINE, TRIANGLE and SQUARE. This difference for each of the three waveforms will be a constant proportional to frequency. If your waveform isn't symetrical, then you'll have to use a little additional hardware to invert the negative going half-cycle and have the PIC measure that too. A little math to perform a sum and mean will then give you your figures to determine the waveform type.

How can you visualise what I am talking about? Get some graph or kiddie math paper (one square per number!). Draw a Square Wave, Sine Wave and a Triangle Wave where one positive-going half-cycle covers five squares high and five squares wide. Let's assume the vertical scale is one volt, and the PIC switches ON at say 1.25v (one and a quarter squres up) and draw a line across the graph. Assume everything above that line is ON, and everything below is OFF. You can immediately see that the ON time is different for each waveform, but it will always be proportional to the frequency.

Your PIC doesn't need to measure with any great accuracy, as long as it can differentiate between the three. If you chose a PIC with comparators, you can set the switching point at a level where differentiation between the three waveforms is most marked (say around 4v) and there is minimum margin for error and greatest margin to account even for sloppy programming. Then it's a simple matter just to say (for example) if the ON time > 80% it has to be SQUARE, if it's > 0 but < 20% it has to be TRIANGLE, otherwise it's SINE. Actually, a couple of Resistors or a POT will achieve this on any PIC without needing Comparators.