if I were too thin and want to have a muscular body, should I grow fat first and then go to gym? or just start GYM directly?
Start gym directly, and follow a healthy strict diet. Diet is most important factor. It will take time to build muscles and you should not lose hope, just go everyday. Some days you are going to feel lazy and wouldn't want to go but I suggest that you suck up and go anyway. Persistence is the key.
Quoting Paulo Coelho: "If you think adventure is dangerous, try routine; it is lethal."
So my friend build a routine and follow it no matter what , be persistent and you will definitely see gains.
Once People get where they want to be they stop working hard, thinking "Now I have reached my goal." but the thing is after reaching your goal you should work more hard to be there otherwise your success will plummet. Same is with body, you should always exercise.
Eat and train, no need to get fat. As you train, the calories you absorb will be allocated to either fat storage or muscle hypertrophy depending on something called your p-ratio. Sadly, your p-ratio gets worse as you get fatter* (iirc beyond 18% bodyfat for males), so I would encourage you to stay within a safe limit of that threshold.
* fat tends to decrease your levels of free testosterone, which is why with the new trend of raw powerlifting (meaning without powerlifting gear that advantages fat lifters) most elite powerlifters now tend to be quite lean.