Penis getting soft and not staying hard for long enough time. Is age 38 too young for viagra (sildenafil) or similar meds?

Not too young. If taking means difference between satisfactory and unsatisfactory sex. However you are young and might consider consulting with a urologic ED expert in case you have a correctible vascular problem. Please quit if you smoke and get a better saddle if you are a cyclist with a hard saddle and no midline groove.