There are a number of cues that the pig's head is not really speaking in Chapter 8. Simon mentions having a "little headache," letting us know he is not well. He realizes that the head "appeared to agree with him" about what's going on—meaning, it really doesn't. The biggest clue is probably the line "so that what was real seemed illusive and without definition." That's pretty much saying that what Simon sees isn't really what is happening, and that includes the pig's head speaking. Due to his personal state, and the emotional upheaval on the island, he's imagining it.
In chapter 8 after Jack runs off to hunt Simon goes to sit alone in the forest. The author tells us that he becomes hot from the sun. He remains and becomes hotter and hotter. He is thirsty and uncomfortably hot. The boys come to butcher the sow near where he is hiding and Jack impales the head of the hog on a stick. Simon sees the head. He says he can still see it when he shuts his eyes. He begins to talk to the pig head. He then realizes that he believes the pig is talking to him, telling him to go back to the others. He becomes disoriented, the flies begin to attack him and he passes out. The clues are the hot sun, the sweating, the thirst, and the trama of seeing the pig's head on a post. Simon begins to hallucinate and talks to the pig.
7. Some indications that show that the pigs head is not speaking is the trauma from seeing the pigs head on the post, the hot sun and the sweating. Simon also mentions "having a little headache" (Golding 137). Another clue is, "so that was real seemed illusive and without definition" (Golding 138). This quote is demonstrating that what Simon is imagining is not real, including the pigs head talking.