"Only" and "solely" mean the same thing in everyday language, that is "exclusively" one thing and not anything else. For example, "I only eat chocolate" or "I solely eat chocolate" means I don't eat anything else.
"Merely" is similar to "just". It emphasises that a quantity or duration of time is smaller than expected, or impressively small. "It merely took five minutes to complete the task" means "it just took five minutes to complete the task" or "it only took five minutes to complete the task", that is to say there is surprise that it did not take longer. "I merely ate five bars of chocolate" means "I only ate five bars of chocolate" in the sense that I could have eaten more but I didn't and perhaps I should be congratulated for that!