There are many reasons why Hamlet's madness might appear to be acted. He explicitly says he will play at madness, and is also a very dramatic, performative character. He wears black and puts on an excessive display of melancholy, from the very beginning up until he is in his famous position holding a skull. Furthermore, his apparently mad ramblings are far too clever to actually be mad - the 'fishmonger' remark cleverly implies that Polonius has essentially prostituted his daughter. We might also compare his 'madness' with Ophelia's: Ophelia seems far more genuinely disturbed, while Hamlet seems to be enjoying his performance.However, Shakespeare loves experimenting with duplicity and falsity within his plays - things aren't always straightforward, or what they seem. Hamlet might be an unreliable narrator, because we see examples of behavior from him that might suggest he has actually grown mad. Therefore, we can't trust what he says and must look at what he does. There are also many reasons that would explain why he has fallen into madness. His over-obsession with his mother's sexuality, as well as Ophelia's suicide, and his feelings of alienation might all have culminated in an actual disturbed mental state.