The book makes it quite clear that his legal name was 'Andrew', but he went by the nickname 'Ender'.
"It wasn't a charade, Mrs. Wiggin. Until we knew what Ender's motivation was, we couldn't be sure he wasn't another-- we had to know what the action meant. Or at least what Ender believed that it meant."
"Must you call him that stupid nickname?" Mother began to cry.
"I'm sorry, Mrs. Wiggin. But that's the name he calls himself."
-- Ender's Game (Chapter 3)
Throughout the book, he is refereed to as 'Ender' by the narrator, and by all of the kids. (his siblings, Stilson's Gang, etc.)
The Adults (Nurse Deedee, Miss Pumphrey, his parents) refer to him by his legal name, 'Andrew'.
It is a sign of the importance that Graff and the rest of the IF places on the Battle School kids, that they choose to use Ender's self-chosen name.
The in-universe explanation for the name is that Valentine found 'Andrew' hard to pronounce.
"Hi," he said.
"Hi," Ender said.
"That's a name?”
"Since I was little. It's what my sister called me.”
"Not a bad name here. Ender. Finisher. Hey.”
-- Ender's Game (Chapter 5)
They knew their teacher only as Speaker for the Dead; they did not know that when he was a mere infant, his older sister, Valentine, could not pronounce the name Andrew, and so called him Ender, the name that he made infamous before he was fifteen years old.
-- Speaker for the Dead (Chapter 2)
Orson Scott Card says that he choose the name 'Ender' to make the title sound like Endgame.
But then again, these are just the reasons from the book. The movie may very well have 'Ender' as his middle name, it wouldn't be the worst change that it has made.