There are two points you have to consider: having Ether to sell and what do you accept as payment.
Basically your contract has to own Ether it can then sell. So you need to buy it from some marketplace and store in the contract. Then you probably want to take some assets from your customers and exchange them for Ethers from your contract - but what are such assets?
Your contract can only accept assets as Ethers or tokens - it can't accept any other types of assets. Accepting Ethers for Ethers doesn't sound reasonable so you'd need to accept tokens as payment, then you have to decide on which tokens and what is the exchange ratio and so on.
In the end you most likely don't want to try to start yet another exchange. Real exchanges basically take fiat and give back Ether but the regulations around those are very strict and complicated.