The market finds it's level
To peg something to another currency, you need to have someone who's willing to pay that for the currency.
In this case, the easiest way is if you're willing to simply pay back the person in Ethereum for their tokens using a simple
sell function in your contract.
So essentially if someone wants some of your token, then they can buy it by sending you some ether, then when they get sick of holding your token they can call a function and get an equal number of ether back for their tokens.
In this situation you will need to keep an adequate balance (a "float") of ether in the contract to cover your expected daily deposits and withdrawals.
External trader markets can find their level but as you're willing to pay back in equal value, it would be silly for an external party to offer less than equal value.
However if there's a limited supply of your tokens and nobody wants to sell, you may end up in a situation where scarcity forces a higher value than you. This fix for this is to make a suitably large (or near-infinite) supply available for purchase.