As mentioned in the answer on SOSO, here is a way to check:
if [ -z ${somevar+x} ]; then echo "somevar is unset"; else echo "somevar is set to '$somevar'"; fi where ${somevar+x} is a parameter expansion which evaluates to the null if var is unset and substitutes the string "x" otherwise.
Using -n, as suggested by the other answer, will only check if the variable contains empty string. It will not check its existence.