The relationship between Charlie Harper and Alan Harper sometimes appears to not be to good. When they were children, Charlie would talk Alan into doing bad things for his own amusement, and so Alan that could get into trouble with their mother, Evelyn.
Charlie has admitted to tying Alan to a streetlight and leaving him there, shaving his hair and one of his eyebrows off in his sleep, putting dog poop in his lunch box when told to make Alan lunch, trying to trade him for an underwater flashlight on two occasions, and painting him. He later claims that he did this in order to "take him down a peg," as Charlie felt Alan was receiving too much praise from their parents and needed some humility.
On one occasion, Charlie placed silly putty in Alan's pocket in a toy store, so Charlie could have it without paying and Alan would get in trouble if they were caught. Alan does get caught and ends up breaking down in tears. Years later in the Season 2 episode "The Price of Healthy Gums Is Eternal Vigilance", they discuss this and Alan keeps denying it, he says the security guard must of planted it on him. Later in the episode, Charlie admits he planted it on Alan, which gets Alan furious. Several times, Charlie and Alan's fights get so bad that Charlie kicks Alan out of the house, which always results in Alan apologising to Charlie. Although they spent most of their time together fighting and arguing Charlie and Alan loved each other greatly, and would have done anything for each other.
When Charlie was killed, Alan was left heartbroken and lonely. For a while, Alan kept his grief bottled up until he snapped and went insane convincing himself that he was Charlie. He started dressing like him and behaving like the deceased. It is mildly implied that Alan was behaving this way to cope with the loss of Charlie.