I'm curious about the meaning of в самом себе.
On its own, does it mean in itself, but in different contexts it can take on different meanings?
For example, in a sentence like Ищите причину неудач в самом себе, the meaning changes to in yourself?
Russian Language Stack Exchange is a question and answer site for students, teachers, and linguists wanting to discuss the finer points of the Russian language. It only takes a minute to sign up.Sign up to join this community
On its own, в самом себе means within oneself. There can be changes in gender (feminine: в самой себе) and in number (plural: в самих себе). Your example is an imperative sentence referring to you (вы, a polite form).
Ищите причину неудач в самом себе. (Find the reason of your misfortune/failure within yourself.)
It means "in the subject of this sentence". In your example, the subject is the person who is supposed to look for the reason, so, "yourself" is the right translation. When used without imperative it would be like "Я ищу причину неудач в самом себе" — "Я" is the subject, so, I'm looking for the reason in myself.
but in different contexts it can take on different meanings?
No! It always means the same thing - the source of the mentioned action. You have to translate it differently because of different usage of words "сам" and "self" in Russian and Englisch respectively. You can say neither *"I did it self" nor *"You did it self" nor *"He did it self". You must always mention whose "self" did it: myself, yourself or himself. That's how English "self" works.
In Russian you say "Я сделал это сам", "Ты сделал это сам" or "Он сделал это сам". Note that it's always "сам" and you must not specify whose "сам" it was (and I think it's even not possible in Russian). That's how Russian "сам" works.
It actually never means "in itself", because it always applies to an animate subject. Could be "[with]in yourself", "[with]in myself" or "[with]in oneself", as another answer put it, "in the subject of this sentence".
As for "in itself", I don't think, there is actually a matching reflective pronoun in Russian, that could be properly applied to an inanimate subject. So, there would not be an exact literal translation in this case, although there are many possible variations. For example, one could translate something like "Ответ содержится в самом вопросе" as "The answer is in the question itself".
Re. reflective pronouns, you can actually say something like "Пустыня отвоевала для себя часть территории у моря" - Dessert won some of the territory from the seа for itself. But I would still say, that here the dessert is being considered like an animate object in some metaphorical sense.