Paying the activation cost of Elixir of Immortality's ability doesn't cause it to leave the battlefield. If you have a way to untap it, you can activate the ability multiple times in response to itself.
As the ability resolves, you'll shuffle Elixir of Immortality into its owner's library directly from the battlefield, if it's still there.
If Elixir of Immortality is in your graveyard at the time the ability resolves, you'll still wind up shuffling it into your library because you shuffle your entire graveyard into your library. If it's anywhere else by that time, including in another player's graveyard, it remains where it is and you shuffle just your graveyard into your library.
If you gain control of another player's Elixir of Immortality and activate it, the Elixir of Immortality will be shuffled into its owner's library and the cards in your graveyard will be shuffled into your library. You are considered to have shuffled each affected library (even if, as a shortcut, each player physically shuffles their own library).