It seems like both 为 and 是 mean "to be". In which cases is one used but not the other? Is it something like the difference between "estar" and "ser" in Spanish and Portuguese? (In the sense that one is constant in time while the other is transient). Thanks.
为 has a lot meanings, and so does 是. A common meaning between 为 and 是 is "to be" or other variations of "to be", like "being". 为 is used more for its other meanings than "to be", while 是 is used more for "to be" than its other meanings. When meaning "to be", in some cases, 为 and 是 are interchangeable. For example:
But there are some cases where 是 cannot be replaced by 为, for example:
为 has another meaning very close to "to be", which is "regard ... as ... " in the pattern of 以...为..., for example
In this case, 为 cannot be replaced with 是. By the way, 为 and 是 can even be used together, like 自以为是. But here 为 means "believe", and 是 means "right", or "correct". 自以为是 means "consider oneself always right". 自以为是 is a derogatory term, used to show dislike, disagreement or disapproval.
Here 是 means "this", 为 means "is", 序 is "preface", so the whole sentence means "this is the preface". It is sometimes used to end a preface.
One more example:
Here both 是 mean "true" or "truth", both 非 mean "false" or "falsehood". All the 4 为 mean "to be".
According to above-mentioned samples, 为 means that it is NOT xxx but very like xxx. In Chinese words, (可能它一定不是xx，但也可能它现在不是xx，将来可能是, 但)把它当作是xx。
Example: 以厂为家，厂 is not home，but someone treats it as home。
为 implies that we assign a role to a thing actively/explicitly, but 是 implies that a thing does natively have the role.
Both words have very broad usages (literal, rhetorical, metaphorical, etc.) and subtleties that must be analyzed within context. Generally speaking, 是 vs. 为 is similar to 'being' vs. '(serving) as', that is, 是 defines the subject while 为 scopes the connotation and/or extension of it.
As far as I know, the main difference lies in how formal they are. 是 is mostly used in colloquial Chinese, whereas 為/为 is much more formal, often used in constructions like 以...為... or just as a single character （1999年国民经济增长预期目标为7%）.
Of course, it should be noted that 為/为 can mean other things than 是, but since you compare it with 是, I'm guessing that's not the problem here. 為/为 is read second tone when it means 是 (that's neither the only meaning of a second tone wei2 nor the only reading of the character, though). If you're not sure about the different kinds of 為/为, perhaps this entry over at Zdic will be useful: http://www.zdic.net/zd/zi/ZdicE4ZdicB8ZdicBA.htm.