If you have side effects on the drug you would, in all honesty, be seriously advised to quit and consider topical anti-androgens, and consider yourself quite lucky if you don't have any persistent side effects after quitting the drug. The brain fog you're experiencing comes from reduction of neurosteroids as a consequence of inhibiting 5 alpha reductase in the central nervous system, some people feel this more than others, and the ED is a result of a reduction of DHT, which being a primary antagonist of estrogen in the male body makes you estrogen dominant, and this negatively impacts sexual function.
There is no way around these side effects, this is just how the drug works, some people are more sensitive than others however. If you experience side effects, they will not likely get better with time, in fact they may get worse and you are increasing your risk of developing permanent side effects even AFTER quitting the drug. This is coming from someone who was desperate enough to keep taking 1.25 mg of Finasteride for one whole year despite developing gynecomastia on the drug. The side effects only got worse after I quit, incl. brain fog, a numb penis with degenerative tissue changes and most of these issues are still with me even 3 years after.
Give RU58841 or CB a try and if that doesn't work out for you then forget about it.