Question: > 
> In class we learned the number of functions from an $m$-element set to an $n$-element set is $n^{m}$. So this answer should be $5^{3}$? 
> 
> 
> 

I just need confirmation if my answer is correct, if not explain to me why it's not.

Answer: 
Let $F$ denote the set of all functions $\{1,2,3,4,5\}\to\{1,2,3\}$. 

For $i=1,2,3$ let $F\_i\subset F$ denote the functions in $F$ that have not $i$ in their image. 

Then you are looking for: $$|F|-|F\_1\cup F\_2\cup F\_3|=3^5-|F\_1\cup F\_2\cup F\_3|$$

Term $|F\_1\cup F\_2\cup F\_3|$ can be found by means of [inclusion/exclusion](https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle) combined with symmetry:$$|F\_1\cup F\_2\cup F\_3|=\binom31|F\_1|-\binom32|F\_1\cap F\_2|=3\cdot2^5-3\cdot1^5$$
When talking about functions, the word 'onto', which you used in the title of the question, has a specific technical meaning (it means the function is 'surjective'). If this is what you meant then the other responses give the answer.

If you were just using 'onto' to mean the same as 'to', then the only problem with your answer is that you swapped the roles of $n$ and $m$, so the answer should be $3^5$. (You can see this, as each of the five elements has a choice of three things the function can send it to, so there are $3\times 3\times 3\times 3\times 3$ possible choices.)