Is an "an element of" expression a truth value? As a programmer learning basic set theory, I'm a bit confused by the symbol $\in$.
For example, let $a$ be a real number and an element of a set $A$. What is the "value" of the expression $a\in A$? Is it


*

*a truth value, such that $(a\in A)\in \{false, true\}$, or

*the number $a$, or

*either of the above, depending on the context?


Also, given another set $B$ such that $A\in B$, is the expression $a\in A\in B$ valid, and is it supposed to be read as $(a\in A)\land(A\in B)$?
 A: The other answers give the usual interpretation in informal mathematical reasoning, but there is also the point of view of formal mathematical logic.
In formal logic, specifically first-order logic, $a \in A$ is a proposition (not an expression).  A proposition is a formal mathematical object, but it is not a member of any set (more accurately, it is not a member of any set within the theory itself). Now, a proposition may be true (or false), if we can prove it to be, but that does not mean it is equivalent to some object in our theory called true. The truthiness of a proposition is given by a meta-theoretic judgement $\phi \text{ true}$.
A: The value of $a \in A$ is always a truth value.
However, there are grammatical contexts where it doesn't make sense to ask about the value of a string of symbols. For example, in the phrase

For every $x \in\mathbb{R}$, $x^2 \geq 0 $

the phrase $x \in \mathbb{R}$ is not used in a context where one would speak it having a value; instead the expression is used to do something different:


*

*Introduce a new variable $x$

*Bind $x$ to the type of real numbers

A: The expression $a\in A$ is a logical statement: it is the assertion that $a$ is an element of $A$.  So its "value" is a truth value: either $a$ is an element of $A$ and the statement is true, or $a$ is not an element of $A$ and the statement is false.  In most contexts we don't think of logical statements as having "values" though; we just say whether they are true or false (and usually only state them if they are true!).
There are some contexts, however, where the notation $a\in A$ is used with the "value" $a$.  For instance, if you say "There exists $a\in A$ such that..." then you are asserting the existence of $a$, not the existence of the truth value of $a\in A$.  More specifically, you are asserting the existence of $a$ such that in addition, the statement $a\in A$ is true.  Another similar context is in set-builder notation: $$\{a\in A:a^2=a\}$$ refers to a set of values of the variable $a$ (such that $a\in A$ is true and $a^2=a$ is true), not a set of truth values of $a\in A$.
Note that these usages are really just quirks of the grammar of mathematical writing, and are not at all particular to the symbol $\in$.  For instance, you can also write "There exists $x>0$ such that..." where you are referring to the existence of $x$ such that $x>0$ is true, not the existence of the truth value of the statement $x>0$.
The notation $a\in A\in B$ is not commonly used, though presumably it would mean "$a\in A$ and $A\in B$".  In general, we only "chain together" statements like this when we are talking about a transitive relation.  So for instance, we write $x<y<z$ for "$x<y$ and $y<z$", since this also implies $x<z$.  But we don't usually write $a\in A\in B$, since this notation misleadingly looks like it would also imply $a\in B$ which is not necessarily the case.  (A funny variant on this is that we do commonly chain together $a\in A\subseteq B$, since these relations are "transitive" in that $a\in A$ and $A\subseteq B$ together imply $a\in B$.)
A: For your first question: The correct option is 3, i.e., it depends on context. For example, you can say

The number $5\in\mathbb{R}$ is a very nice number, and its name in English is "five'.

and you can also say

The statement $\sqrt{2}\in\mathbb{Q}$ is false, as was proven by the Greeks.

For your second question: Yes, that is how it should be read, $a\in A\in B$ means that $a\in A$ and $A\in B$. It's a similar sort of combined notation to saying $x\leq y\leq z$ for numbers, for example.
A: You have to distinguish formulas from their truth value. The truth value of a closed formula is the application of the truth value fonction to the closed formula.
