Can the same node appear twice in a tree? Can the same node appear twice in a tree? 

I'm asking about the node object itself, not the node's value. For example, in the following code, a's left and right are the same node, b.

a = new TreeNode(1);
b = new TreeNode(2);
a.left = b; 
a.right = b;


Is this valid? Why or why not?
A tree is defined to be a set of nodes, with a parent-child relationship that satisfies certain properties.  Thus, it doesn't make sense to ask whether a node can "appear" twice.

In your code snippet, you have constructed a DAG, not a tree.