How does the capacitor behave here?
I tried and the led flashed. Does the capacitor work like a diode after charging?
The capacitor acts like a capacitor. It charges up like it normally does, but when the voltage potential measured at the anode reaches the LED's turn on voltage, the diode's junction internal resistance goes down, and the current flows through the diode, discharges the capacitor until the voltage potential has lowered past the junction off voltage, then the capacitor charges up at the rate of the dark current (normal junction leakage current when not turned on)