Does erectile dysfunction sometimes clear up by itself?

Yes. Erectile dysfunction is fairly common, especially as a man ages. In many instances it can improve or resolve if the factors that lead up to the problem improve or resolve such as better control of diabetes, weight loss, and control of high blood pressure.
Yes. Many times if the cause is emotional; if one is able to relax more with their partner it subsides.