I don't have an idea as how token price is setup.
There are two prices to consider here:
- The price you sell the tokens for during the ICO/crowdsale;
- The price your token trades at on exchanges once the ICO is complete.
You can control the price in point 1; you have no control over the price in point 2.
If you see this example of token BOMB, it has market price shown on etherscan.
You can't set this value. This value is derived as an aggregate from different exchanges that are trading that token. The price on those exchanges is set by the market (i.e. supply and demand), not something hard-coded in the contract.
My question is that how this market price is established?
Supply and demand on the exchanges. If no one wants your token, no one will buy it, and it will be worthless.
Do I need to list it anywhere or what?
You need to approach exchanges and ask them to list your token.
...can I get this market price value inside my solidity contract?
You can using an oracle...
...however, I think you're probably conflating the two prices at the top of this answer - 1 and 2.
It sounds like you're about to run an ICO, in which case you want to set the ICO/crowdsale price, which means you want a separate crowdsale contract as well as your ERC-20 contract.
After the ICO is finished, and you've listed your ERC-20 token on exchanges, then the market's trading price for your token will appear on Etherscan.