I assume that you are implying that your real estate agent is the listing agent for your house. Your real estate agent can buy your house from you. The question is whether the action is ethical or not.
Ultimately, you decide whether his | her actions are acceptable. If he is offering price and terms acceptable to you, then what difference would it make if he offered it to you or someone else offered it to you as long as he was honest in his dealing with you? If you feel that he was not honest with you in preparing and pricing your house, then you can always turn down his offer. You are the seller and determine what price and terms you accept.
Was this agent your listing agent? If so, from where I stand this could involve a conflict of interest unless properly handled. Additional information would be helpful.
But if you feel you were taken advantage of, consider contacting the agent's broker followed by the local board of realtors if still feel you were not treated fairly.
When a Realtor buys your house, he/she is supposed to disclose to you that he/she is a Realtor. That's for your protection. But if you are aware that the purchaser is a Realtor--perhaps with a better knowledge of values than you yourself have--and you are willing to sell at an agreed-upon price, that's OK. And then if the Realtor wishes to put it on the market to sell it, that's OK, too.
The most likely area of difficulty is whether the purchasing Realtor made full disclosure. And if it was your own agent, then it gets even more complicated.
You might want to check with your agent's broker.
Hope that helps.
We can help, but we need a little more information to answer your question clearly.