1. I don't like pears, either.

2. I like pears, too.
3. I also like pears.
4. I like pears as well.
5. I also don't like pears.
6. I don't also like pears.
7. I don't like pears as well.
---------------------------------
Are they all grammatical? Can we use 'also' or 'as well' in a negative sentence?

The comma is not usually used any more in 1 & 2. It used to be, but things change (grammar, language in general). #6 really doesn't make sense; "also" is misplaced. Better to write, "I also don't like pears" (also could mean that there are other fruits you don't like too, or that you agree with someone else that you both dislike pears).

Well, I still teach that the comma (as in 1 and 2) is still needed! But Reed is right that English is a living language and changes are always occurring, usually slowly.

1. OK
2. not OK
3. OK
4. OK
5. OK
6. not OK -- word order is the problem; #5 is the correct word order.
7. OK, but seems awkward

Yes, all of the sentences you provided are grammatically correct. Both "also" and "as well" can be used in both positive and negative sentences.

In sentences 1, 2, 3, and 4, "also" and "as well" are used to indicate agreement with a positive statement. These sentences express that the speaker shares the same liking for pears as someone else.

In sentences 5, 6, and 7, "also" and "as well" are used to indicate agreement with a negative statement. These sentences express that the speaker shares the same dislike for pears as someone else.

When using "also" or "as well" in negative sentences, it is important to place it correctly in the sentence structure. Sentence 6, "I don't also like pears," is not grammatically correct because "also" should come before the verb "don't." The correct phrasing would be "I also don't like pears."