I studied mechanical engineering in university. (In the US we would probably say “in college”, instead of “in university”, but the way you said it might be more common in other English-speaking countries.)
I don't know why I chose it. I didn’t realize that’s what my major was going to be until I was in the opening ceremony. (We don’t have opening ceremonies for universities in the US, so I’m not sure what you mean here, but this is the way I would say it. I think,) I kept regretting the decision during school. (It sounds more natural to me to say "thereout" instead of "during" here, but during isn't incorrect)
After only 5 years or so, I am back to school again. Now I learn what I chose to learn.