...As well as all the imaginary characters in the movie. An imaginary character is born through unhappiness and can only be seen and kept alive when you believe in him/her. When the child stops believing in his/her friend, the friend dies. Once the kid is happy the Friend moves on to help another unhappy child. Fred was around because Lizzy was unhappy all the time. He's the only one who could see the other imaginary friends because he is one too. Lastly the antipsychotics nearly kill him.
Running with above mentioned guess, Fred is or was Lizzie's Guardian Angel. At the end when he becomes Natalie's "imaginary friend" seems to imply that imaginary friends in this world get "assigned" if you will, to children when needed. Fred himself even states at the beginning that he can't leave Lizzie until she's happy! Both Lizzie and Natalie come from broken homes...
We don't see what happens in the 21 years between when Fred is trapped in the Jack-in-the-Box and when Lizzie's life starts crashing down. The box is Lizzie's mental representation of heavy-duty antipsychotics, which manage to keep Fred away and keep her at least somewhat grounded in reality. When we meet her in the movie, Lizzie has finally developed a tolerance to the drugs; the delusions come back and Fred breaks free. Although Lizzie envisions herself defeating her fears and no longer needing him she cannot ever escape from her delusion, and therefore Fred will always reappear in her life. This also explains the unstable reactions of everyone else, Lizzie cannot comprehend normal reactions, so the people in her delusions react at random.
The film is about the repercussions of psychological abuse by a parent and how that abuse keeps affecting you right into adulthood, but because of the wacky imaginary friend motif, it was advertised as a child-friendly screwball comedy. The wrong audience saw it, and the critics came in expecting an entirely different movie, effecting their reviews. The movie isn't a work of art, but it's enjoyable with the right taste and mindset, and advertising it as a movie about the affects of bullying might have helped it.
Lizzy's father was the only adult we see being nice to Lizzy as a child, and he hated the way her mother treated her enough for her bullying of Lizzy to make him decide to divorce. Seeing as her mother only had Lizzy to save the marriage in the first place, he probably started disliking his wife's personality long before Lizzy was even born. Because of her dad's kindness, Lizzy grew up associating English people with kindness and fun.
We never see him when Lizzy is an adult, even though she clearly had a better relationship with him than her mother and he would have wanted to help her when she lost her husband, job and car. Even if he didn't have primary custody of her as a child, he doesn't seem like the type who would stay out of Lizzy's life once the marriage ended. Furthermore, in adulthood, Lizzy is almost totally dependent on her mother, which would have been exacerbated if she was grieving for her beloved father. Perhaps he was in an accident or struck down by an illness.
This is helped along with the fact that Rik Mayall was supposed to actually play Peeves in the Harry Potter movies, but got cut out, hell, Peeves is even described as a loud-mouthed, Red-haired, loudly dressed prankster, just like Fred, Fred may have been the reason Rik was considered for the role.
The Episode "Just my Imagination" Reveals that Imaginary friends are real, being creatures called "Zanna" who interact very similarly to Fred, being invisible to anyone but their chosen friend, even upto adulthood if they choose, being able to interact with the world in a limited way, and being able to see and interact with other childrens "Imaginary friends", But, he is possibly a "rogue" Zanna who ends up being more destructive than helpful.