Do Hamlet and Ophelia get together at the end of the play?
No, unfortunately not. Ophelia has become an unfortunate victim of Hamlet's so-called madness. She had been confused by his behaviour since he, in this state, had intermittently expressed both his interest in her and rejected her, playing on her emotions. She tells her father:
He hath, my lord, of late made many tenders
Of his affection to me.
Hamlet, later however, informs her:
You should not have believed me; for virtue cannot
so inoculate our old stock but we shall relish of
it: I loved you not.
To add to her confusion, she has received advice from her brother, Laertes, and her overly concerned father, Polonius, to not give Hamlet too much rope.
If with too credent ear you list his songs,
Or lose your heart, or your chaste treasure open
To his unmaster'd importunity.
Fear it, Ophelia, fear it, my dear sister,
And keep you in the rear of your affection,
Out of the shot and danger of desire.
He is fearful that his beloved sister might get hurt if Hamlet should reject her because she is below his station and he would be obliged to choose or marry someone of his rank.
Polonius later states:
Do not believe his vows; for they are brokers,
Not of that dye which their investments show,
But mere implorators of unholy suits,
Breathing like sanctified and pious bawds,
The better to beguile. This is for all:
I would not, in plain terms, from this time forth,
Have you so slander any moment leisure,
As to give words or talk with the Lord Hamlet.
Look to't, I charge you: come your ways.
Polonius forbids her to have any contact with Hamlet, since he believes that Hamlet's declarations of affection are merely to mislead her into doing something foolish. He changes his mind later, though, in an attempt to get to the bottom of Hamlet's strange behaviour and instructs her to make contact with him.
She is obviously in love with Hamlet and is torn apart by not only the mixed messages sent by him, but also by the advice of her brother and the stern admonition from her father (whom she clearly respects) and his later request.
To crown it all, Hamlet is also responsible for her father's death. He stabbed Polonius, who was hiding behind the curtain in his mother's room, believing that it was Claudius. Polonius had, at the time, been snooping on their conversation on Claudius' instruction.
All of this has become too much for her sensitive soul and she is driven to utter despair. Her strange behaviour is witnessed by others, such as Queen Gertrude and King Claudius who express their concern. Her deep depression drives her to madness and, when she falls into a river whilst leaning on a bough, makes no attempt to save herself and tragically drowns.
Queen Gertrude divulges the tragic news to Laertes:
There, on the pendent boughs her coronet weeds
Clambering to hang, an envious sliver broke;
When down her weedy trophies and herself
Fell in the weeping brook.
As one incapable of her own distress,
Or like a creature native and indued
Unto that element: but long it could not be
Till that her garments, heavy with their drink,
Pull'd the poor wretch from her melodious lay
To muddy death.