At the end, Charlie was lonely, depressed, lost everything he worked for to be smart, and had suicidal thoughts. And at the beginning, he had friends, a job he liked, and knew there was a possibility of being smart. So, he was clearly much happier at the beginning.
Charlie was much happier at the beginning than at the end because at the end he was lonely, sick, and depressed. At the beginning of the story, he had his friends and was pretty happy with his life.