You want Fietype specific autocmds:
autocmd Filetype tex,latex inoremap ½ \frac{1}{2}
Try something like that. This depends on the Filetype
option being on (see here). You can set it with set Filetype on
You can also use an autocmd that checks for the filename when reading or creating a new file:
autocmd BufNewFile,BufRead *.latex inoremap ½ \frac{1}{2}
Also, you should confirm that hitting the 1/2 key on your keyboard actually inputs the 1/2 symbol, otherwise obviously this isn't going to work. Regardless, you can figure out what code the 1/2 key actually inserts by (in insert mode) hitting ctrl-v and then the physical key.