Notes on the above answers
Backticks are considered deprecated by now (many further notes), so I advise on switching to $(( ... )) or $( ... ) constructs.
Both expr (man page), and bc (man page) are external commands, and as such would cause some measurable slowdown in more complex examples than mine or those above. Furthermore, there already is a way to easily avoid them (both). Also, they might not be available on all systems by default for instance.
Suggested new solution
(Might be imperfect under certain conditions, I did test just basic scenarios.)
The simplest possible while portable and POSIX-ly correct code (no Bashisms (Greg's Wiki on how to re-write Bash snippets to POSIX); (Wikipedia overview on POSIX)) to test oddity (as an example) of a number would be as follows:
#!/bin/sh
n=10
if [ $(( n % 2 )) -eq 0 ]; then
printf '%s\n' "Number $n is Even"
else
printf '%s\n' "Number $n is Odd"
fi
You can, of course, test any modulo there, not just if a number is even / odd.