This is a script to download sequences and create a blastdb on the fly, I haven’t tried it, but looks promising.
If you have a lot of genes to annotate, this is certainly an option.
Another option is to use InterProScan that can also give you GO annotations. These are based on protein families and domains. In my experience these terms are slightly different (in a good way) from what you get by pure blast searches. They are more “conservative” than e.g. blas2go terms, that means you get less, but those ones you get are normally specific (blast2go also assigns top level or high level terms like “biological process” which are not informative) and more reliable. In order to annotate whole genomes, it is recommended to use a local installation of InterProScan.
Another commercial tool that come to mind are Blast2GO, the free test version should definitely get you an annotation, but for a single gene both methods might be overkill.
If you know the gene name/symbol, try AmiGO gene search. If you have the sequence only, run blast in UniprotKB (or local blast vs. SwissProt) and extract whatever GO terms come up there.
Get the sequence for your gene, find the most similar annotated genes (from other, annotated organisms) then evaluate whether the similarity is sufficiently high to assume that the gene has similar functions.