After writing and defending his dissertation On the Concept of Irony with Continual Reference to Socrates (1841), Kierkegaard left Copenhagen in October 1841 to spend the winter in Berlin.
The main purpose of this visit was to attend the lectures by the German philosopher Friedrich Wilhelm Joseph Schelling, who was an eminent figure at the time.
The lectures turned out to be a disappointment for many in Schelling's audience, including Mikhail Bakunin and Friedrich Engels, and Kierkegaard described it as "unbearable nonsense".
During his stay, Kierkegaard worked on the manuscript for Either/Or, took daily lessons to perfect his German and attended operas and plays, particularly by Wolfgang Amadeus Mozart and Johann Wolfgang von Goethe.
He returned to Copenhagen in March 1842 with a draft of the manuscript, which was completed near the end of 1842 and published in February 1843.

According to a journal entry from 1846, Either/Or was written "lock, stock, and barrel in eleven months" ("Rub og Stub, i 11 Maaneder"), although a page from the "Diapsalmata" section in the 'A' volume was written before that time.

The title Either/Or is an affirmation of Aristotelian logic, particularly as modified by Johann Gottlieb Fichte and Immanuel Kant.
Is the question, "Who am I?"
a scientific question or one for the single individual to answer for him or herself?

Fichte wrote in The Science of Knowledge "An in itself returning activity (Egohood, subjectivity) is character of the rational being.
The positing of itself (reflecting about itself) is an act of this activity.
Let this reflection be called A. The rational being posits itself through the act of such an activity.
All reflection reflects something as its object; let this object be called B. Now, what sort of a something must this object be as object of the reflection A. In A the rational being is to posit itself, is to be its own object; but its character is in itself returning activity.
The last highest object (B) of its reflection must therefore also be in itself returning, or itself determining activity, since otherwise it would not posit itself as a rational being, and hence would not posit itself at all." ...
 "The question has been asked, What was I before I became self-conscious?
The answer is, I was not at all, for I was not I. The Ego is only in so far as it is conscious of itself. ….
The proposition not A is not A will doubtless be recognized by every one as certain, and it is scarcely to be expected that any one will ask for its proof.
If, however, such a proof were possible, it must in our system be deduced from the proposition A=A. But such a proof is impossible."

Law of identity (A = A; a thing is identical to itself)
Law of excluded middle (either A or not-A; a thing is either something or not that thing, no third option)
Law of noncontradiction. (
not both A and not-A; a thing cannot be both true and not true in the same instant)
In Georg Wilhelm Friedrich Hegel's work, The Science of Logic (1812), Hegel had criticized Aristotle's laws of classical logic for being static, rather than dynamic and becoming, and had replaced it with his own dialectical logic.
Hegel formulated addendums for Aristotle's laws:
Law of identity is inaccurate because a thing is always more than itself
Law of excluded middle is inaccurate because a thing can be both itself and many others
Law of non-contradiction is inaccurate because everything in existence is both itself and not itself

Kierkegaard spoke of Hegel's Logic metaphorically in 1844: 
Thus when an author entitles the last section of the Logic "Actuality," he thereby gains the advantage of making it appear that in logic the highest has already been achieved, or if one prefers, the lowest.
In the meantime, the loss is obvious, for neither logic nor actuality is served by placing actuality in the Logic.
Actuality is not served thereby, for contingency, which is an essential part of the actual, cannot be admitted within the realm of logic. ...
If anyone would take the trouble to collect and put together all the strange pixies and gobli
After writing and defending his dissertation On the Concept of Irony with Continual Reference to Socrates (1841), Kierkegaard left Copenhagen in October 1841 to spend the winter in Berlin. The main purpose of this visit was to attend the lectures by the German philosopher Friedrich Wilhelm Joseph Schelling, who was an eminent figure at the time. The lectures turned out to be a disappointment for many in Schelling's audience, including Mikhail Bakunin and Friedrich Engels, and Kierkegaard described it as "unbearable nonsense". During his stay, Kierkegaard worked on the manuscript for Either/Or, took daily lessons to perfect his German and attended operas and plays, particularly by Wolfgang Amadeus Mozart and Johann Wolfgang von Goethe. He returned to Copenhagen in March 1842 with a draft of the manuscript, which was completed near the end of 1842 and published in February 1843.
According to a journal entry from 1846, Either/Or was written "lock, stock, and barrel in eleven months" ("Rub og Stub, i 11 Maaneder"), although a page from the "Diapsalmata" section in the 'A' volume was written before that time.
The title Either/Or is an affirmation of Aristotelian logic, particularly as modified by Johann Gottlieb Fichte and Immanuel Kant. Is the question, "Who am I?" a scientific question or one for the single individual to answer for him or herself?
Fichte wrote in The Science of Knowledge "An in itself returning activity (Egohood, subjectivity) is character of the rational being. The positing of itself (reflecting about itself) is an act of this activity. Let this reflection be called A. The rational being posits itself through the act of such an activity. All reflection reflects something as its object; let this object be called B. Now, what sort of a something must this object be as object of the reflection A. In A the rational being is to posit itself, is to be its own object; but its character is in itself returning activity. The last highest object (B) of its reflection must therefore also be in itself returning, or itself determining activity, since otherwise it would not posit itself as a rational being, and hence would not posit itself at all." ...  "The question has been asked, What was I before I became self-conscious? The answer is, I was not at all, for I was not I. The Ego is only in so far as it is conscious of itself. …. The proposition not A is not A will doubtless be recognized by every one as certain, and it is scarcely to be expected that any one will ask for its proof. If, however, such a proof were possible, it must in our system be deduced from the proposition A=A. But such a proof is impossible."
Law of identity (A = A; a thing is identical to itself)
Law of excluded middle (either A or not-A; a thing is either something or not that thing, no third option)
Law of noncontradiction. (not both A and not-A; a thing cannot be both true and not true in the same instant)
In Georg Wilhelm Friedrich Hegel's work, The Science of Logic (1812), Hegel had criticized Aristotle's laws of classical logic for being static, rather than dynamic and becoming, and had replaced it with his own dialectical logic. Hegel formulated addendums for Aristotle's laws:
Law of identity is inaccurate because a thing is always more than itself
Law of excluded middle is inaccurate because a thing can be both itself and many others
Law of non-contradiction is inaccurate because everything in existence is both itself and not itself

Kierkegaard spoke of Hegel's Logic metaphorically in 1844: 
Thus when an author entitles the last section of the Logic "Actuality," he thereby gains the advantage of making it appear that in logic the highest has already been achieved, or if one prefers, the lowest. In the meantime, the loss is obvious, for neither logic nor actuality is served by placing actuality in the Logic. Actuality is not served thereby, for contingency, which is an essential part of the actual, cannot be admitted within the realm of logic. ... If anyone would take the trouble to collect and put together all the strange pixies and gobli
Either/Or