I have a offer from a research firm in which the job is to give investment advice on a particular stock in the capital market. My duty is to study the company and analyse it thereby coming to conclusion whether to buy or sell the stock. I know studying and analysis company's engaging in haram activities are not allowed in Islam but is it ok if I limit to giving advice on companies that have halal dealings?
Yes. It's halal as you are facilitating the trading of Halal products i.e. shares in halal companies.
Those who consume interest cannot stand [on the Day of Resurrection] except as one stands who is being beaten by Satan into insanity. That is because they say, "Trade is [just] like interest." But Allah has permitted trade and has forbidden interest. So whoever has received an admonition from his Lord and desists may have what is past, and his affair rests with Allah . But whoever returns to [dealing in interest or usury] - those are the companions of the Fire; they will abide eternally therein. (Qur'an 2:275)
If you are indulged only in halal dealings with them, then your case is analogous to trading, irrespective of whether the opposite is a believer or not.
So, you can and it is permissible.
Prophet Muhammad (peace be upon him) said "If you see something wrong try to correct it with your own hands, if you are not able try to correct it by talking to the person that did that wrong, if not try by your heart and this is the least of faith."
So, try to implement the aspects of the above hadith as much as possible.
May the creator guide us all.