Im solving a problem where I have to calculate the ripple voltage for a half-wave rectifier (with a diode and capacitor) and the formula is V=I/(fC). I like to know where the formulas come from, how can I arrive at this result ?
The formula is an approximation.
A half wave rectifier will recharge your cap on every period, which means every \$ T=1/f \$ seconds.
If the load draws a current \$ i \$, since \$ i = C dv/dt \$ then \$ v \$ will decrease by \$ iT/C = i/(fC) \$ on every period, so you have your answer.
The approximation lies in the fact that the time needed to recharge the cap is not zero, so during a part of the period the load will be supplied directly through the rectifying diode. Real-world ripple voltage will thus be a bit less than predicted. The real value depends on lots of factors, like diode dynamic resistance and other resistances in the circuit (transformer wiring, etc) so it's difficult to model... but \$ i/fC \$ gives a worst case estimation, which in most cases is all we need.
You can simulate it using the online schematic editor...