How can I write this simple function in mathematical notation?
While you are free to use whatever notation you want, as long as you explain it, it seems that the simplest solution here would be


  $$ score(answer) = \sum_{i=0}^3 POINTS\_TABLE[answer[i]] $$


This should be self-explanatory in most circumstances.