Having had similar problem done a bit of reading around this, things I've found-
Mental tasks can be difficult due to four main points/stages:
memory and retaining info,
articulation/expression of ideas .
The four stages rely on eachother so if one of them doesn't work the whole process is very difficult, but it's not that you are "thick" over all-just a problem with one element (i.e you might be able to concentrate but can't retain the info. or you can retain it but can't organise it etc.)
These things can be difficult due to cognitive changes that can happen in MS but they may also simply be due to factors like fatigue/mental fatigue, depression, stress, emotional impact of diagnosis, side effect of meds-all contributing to what may seem like a cognitive change. It may be a cognitive change- you could see a nueropsych to assess this?
Not sure if this applies to you at all but I had a long period away from studying, and found things seemed a bit sluggish when I resumed, think this happens MS or not-lack of engagment over an extended period caused everything to be a bit slow/foggy, brain is like a muscle in the body that needs to be used and kept active, things may improve once you've shaken the dust off? Also just to say, I have found like any other symptom- it may be transient and improve etc.
I find it helpful to pace myself with mental activity just as I would for physical activity,take breaks/ use my good hours, pkan nothing either side etc. Also I find repetition very useful when reading/learning new things, I expect nothing to "go in" the first time I read something, I also find it helpful to explain things I've learnt to other people as a way of getting them to stick in my mind. For writing, I find it useful to write down whatever I can (even if it's a "bit thick") and then come back to it when I am bit more focused/articulate etc. I'm also thinking about doing all the sort of brain training that's around at the moment and even things like puzzles/ suduko etc. Really understand how you feel - perhaps understanding the exact causes will help you find solutions. Good luck with your work-try to enjoy it!