Driving an LED with a low amplitude square wave as an input of MOSFET switch
Observe the datasheet of your MOSFET, figure 5 "Transfer characteristics" at page 5. Your transistor only starts conducting significant current when Vgs (the gate to source voltage) reaches 2 volts. This is called the treshold voltage. As the amplitude of your signal is quite low, Vgs never reaches a voltage high enough and your MOSFET fails to conduct enough current for the LED to turn on properly.

In order to fully turn on the led, your circuit only needs a small modification: you need to add a DC bias to the gate of the MOSFET. This can be accomplished with a dc blocking capacitor and a voltage divider:







simulate this circuit &ndash; Schematic created using CircuitLab

The 47kΩ and 33kΩ resistors form a voltage divider, maintaining the gate of the MOSFET at an average voltage of 5V * 33kΩ / (47kΩ + 33kΩ) = 2,06V relative to the source. Your signal is AC coupled to the gate, causing Vgs to go above and below the threshold voltage and thus switch the state of the LED.

If you need to connect a lower impedance load to the MOSFET (that draws a current higher than a couple hundred milliamperes when on), you need to add a proper gate driver between your signal and the gate of the tansistor.