Loki is the hardest figure in Norse myth to classify, and that is the point of him. He is counted among the Aesir and is Odin's sworn blood-brother, yet he is the son of a giant, and he moves between the two worlds that every other figure belongs firmly to one of. He is not a god of anything in particular, there is no cult of Loki, no evidence he was worshipped, but a principle of change, trickery and reversal loose inside the divine order.
For much of the mythology he is genuinely useful. His cunning gets the gods out of trouble as often as into it: he recovers Thor's stolen hammer, he tricks the builder of Asgard's wall out of his payment, and in doing so, shape-shifted into a mare, he becomes the mother of Odin's eight-legged horse Sleipnir. He changes sex and shape freely, which the sources treat as one of his defining and unsettling traits.
But Loki is also the father, by a giantess, of three monsters who will destroy the gods: the wolf Fenrir, the world-serpent Jormungandr, and Hel, who rules the dead. The trickster and the doom of the gods are, in his person, the same being.