I can think of four possible reasons why you might think that your cat or dog is like you in terms of character. A University of California, Berkeley study carried out many years ago found that sometimes owners believe that their kitty or puppy have personalities resembling their own.

Selection
One reason is that a cat or dog adopter may be inclined to adopt an animal with a personality that is similar to theirs. For instance, an introverted, mild-mannered person might adopt a cat who is retiring and a little frightened in a rescue centre. Whereas an outgoing extrovert of a person might adopt a boisterous dog or a very confident cat who wanders up to him at a cat rescue centre. It’s just a theory and it sort of reflects how people think of themselves. Perhaps they are choosing an animal that is like them or that they believe is like them because they think they will get on better with that animal in the long term. There is also perhaps an element of reassurance here. If you live with a sentient being which you believe is like you, it’s more comfortable. There is less possibility of hostilities and arguments and it’s reassuring.
Projection
The companion animal is in reality not like their owner but the owner thinks that their companion animal is because they are projecting their personality on their animal! This form of human personality projection is probably quite commonplace. And people tend to interpret dog and cat behaviour based on human behaviour which is another form of personality projection. You have to interpret dog and cat behaviour on the basis of their inherited traits from their wild ancestors. Although it’s quite cute to relate to a cat or dog as a little person and a member of the family (they are members of the family!) it can be unhelpful as a way of interpreting their behaviour in order to solve perceived behavioural problems. Animal “behavioural problems” are actually natural behaviours which their owner is unsure about or doesn’t like.
Reward
Another possible theory is that cat and dog owners involuntarily train their pets to behave like them by rewarding them when they do actually behave in a way which their owner believes is how they would behave. I guess it’s a form of projection.
Your pet is like you!
I have to add a fourth reason which is a logical one. Your companion animal is indeed like you in a companion animal sort of way. Clearly an animal cannot be precisely like a human because this thy are different species but the general demeanour of an animal and their underlying behavioural characteristics may resemble to a certain extent those of their human caretaker.
P.S. Quite rarely but sometimes cat breeders breed cats that look like humans! Possibly this is a reflection on the above theories.