He was so fascinating. I think given the fact his name is Loki makes him even more intriguing. Is it even his real name? You only get one line about his past but that's it. Nothing much is explained about his character. He has these tattoos, a peculiar ring that has what significance to him exactly? He has this tic, he walks eschewed, and he doesn't wear a belt or a tie, but still buttons up his shirt completely. I doubt a whole lot of this was in the script if any. These are mostly actor/director contributions.
He's not your typical detective character we've seen before. Hell, he isn't completely the most trustworthy guy just by all of the things I listed. He's a guy who looks more like he was on the other side of the law at once point than on it. I read somewhere Gyllenhaal said at one point he was a prisoner in his life (hence the boys home reference) but I'm thinking he served some prison time as well. He's about as mischievous looking as his name suggests. You don't even know his first name!
He's an enigma really. But you're captivated by him by his fascinating and strange introduction. You know this is something we haven't seen him in before.
The thing is, as much as I love Christian Bale, Gyllenhaal fit this role like a glove. He's young enough where the character is required, but looks old enough to believe his reputation as an effective detective from past cases. On paper, he's your typical young and brash detective, but Gyllenhaal and Villeneuve gave him so much more layers that I think if it was another combo like Bale and Singer it wouldn't have been as unique and intriguing.
And despite all of his idiosyncrasies, you like him. Alot.