Find all positive integers $a\in \{1,2,3,4\}$ such that if $b=2a$, then there exist infinitely many positive integers $n$ such that $$\underbrace{aa\dots aa}_\textrm{$2n$}-\underbrace{bb\dots bb}_\textrm{$n$}$$ is a perfect square.
To solve the problem, we need to find all positive integers \( a \in \{1, 2, 3, 4\} \) such that if \( b = 2a \), then there exist infinitely many positive integers \( n \) such that 
\[ \underbrace{aa \dots aa}_{2n} - \underbrace{bb \dots bb}_{n} \]
is a perfect square.

1. **Case Analysis for \( a = 1 \):**
   - If \( a = 1 \), then \( b = 2 \).
   - Consider the numbers formed by repeating the digits:
     \[ \underbrace{11 \dots 11}_{2n} \text{ and } \underbrace{22 \dots 22}_{n} \]
   - Let \( x = \underbrace{11 \dots 11}_{n} \). This means \( x \) is a number consisting of \( n \) digits of 1.
   - The number \( \underbrace{11 \dots 11}_{2n} \) can be written as \( x \cdot (10^n + 1) \).
   - The number \( \underbrace{22 \dots 22}_{n} \) can be written as \( 2x \).
   - Therefore, we have:
     \[ \underbrace{11 \dots 11}_{2n} - \underbrace{22 \dots 22}_{n} = x \cdot (10^n + 1) - 2x = x(10^n + 1 - 2) = x(10^n - 1) \]
   - Notice that \( x = \underbrace{11 \dots 11}_{n} \) is a number consisting of \( n \) digits of 1, which can be written as:
     \[ x = \frac{10^n - 1}{9} \]
   - Substituting \( x \) into the equation:
     \[ x(10^n - 1) = \left( \frac{10^n - 1}{9} \right)(10^n - 1) = \frac{(10^n - 1)^2}{9} \]
   - This is a perfect square since:
     \[ \left( \frac{10^n - 1}{3} \right)^2 \]
   - Therefore, for \( a = 1 \), the expression is a perfect square for infinitely many \( n \).

2. **Case Analysis for \( a = 2 \):**
   - If \( a = 2 \), then \( b = 4 \).
   - Consider the numbers formed by repeating the digits:
     \[ \underbrace{22 \dots 22}_{2n} \text{ and } \underbrace{44 \dots 44}_{n} \]
   - Let \( y = \underbrace{22 \dots 22}_{n} \). This means \( y \) is a number consisting of \( n \) digits of 2.
   - The number \( \underbrace{22 \dots 22}_{2n} \) can be written as \( y \cdot (10^n + 1) \).
   - The number \( \underbrace{44 \dots 44}_{n} \) can be written as \( 2y \).
   - Therefore, we have:
     \[ \underbrace{22 \dots 22}_{2n} - \underbrace{44 \dots 44}_{n} = y \cdot (10^n + 1) - 2y = y(10^n + 1 - 2) = y(10^n - 1) \]
   - Notice that \( y = \underbrace{22 \dots 22}_{n} \) is a number consisting of \( n \) digits of 2, which can be written as:
     \[ y = 2 \cdot \frac{10^n - 1}{9} \]
   - Substituting \( y \) into the equation:
     \[ y(10^n - 1) = 2 \cdot \frac{10^n - 1}{9} \cdot (10^n - 1) = \frac{2(10^n - 1)^2}{9} \]
   - This is not a perfect square since \( \frac{2(10^n - 1)^2}{9} \) is not a perfect square for any \( n \).

3. **Case Analysis for \( a = 3 \):**
   - If \( a = 3 \), then \( b = 6 \).
   - Consider the numbers formed by repeating the digits:
     \[ \underbrace{33 \dots 33}_{2n} \text{ and } \underbrace{66 \dots 66}_{n} \]
   - Let \( z = \underbrace{33 \dots 33}_{n} \). This means \( z \) is a number consisting of \( n \) digits of 3.
   - The number \( \underbrace{33 \dots 33}_{2n} \) can be written as \( z \cdot (10^n + 1) \).
   - The number \( \underbrace{66 \dots 66}_{n} \) can be written as \( 2z \).
   - Therefore, we have:
     \[ \underbrace{33 \dots 33}_{2n} - \underbrace{66 \dots 66}_{n} = z \cdot (10^n + 1) - 2z = z(10^n + 1 - 2) = z(10^n - 1) \]
   - Notice that \( z = \underbrace{33 \dots 33}_{n} \) is a number consisting of \( n \) digits of 3, which can be written as:
     \[ z = 3 \cdot \frac{10^n - 1}{9} \]
   - Substituting \( z \) into the equation:
     \[ z(10^n - 1) = 3 \cdot \frac{10^n - 1}{9} \cdot (10^n - 1) = \frac{3(10^n - 1)^2}{9} \]
   - This is not a perfect square since \( \frac{3(10^n - 1)^2}{9} \) is not a perfect square for any \( n \).

4. **Case Analysis for \( a = 4 \):**
   - If \( a = 4 \), then \( b = 8 \).
   - Consider the numbers formed by repeating the digits:
     \[ \underbrace{44 \dots 44}_{2n} \text{ and } \underbrace{88 \dots 88}_{n} \]
   - Let \( w = \underbrace{44 \dots 44}_{n} \). This means \( w \) is a number consisting of \( n \) digits of 4.
   - The number \( \underbrace{44 \dots 44}_{2n} \) can be written as \( w \cdot (10^n + 1) \).
   - The number \( \underbrace{88 \dots 88}_{n} \) can be written as \( 2w \).
   - Therefore, we have:
     \[ \underbrace{44 \dots 44}_{2n} - \underbrace{88 \dots 88}_{n} = w \cdot (10^n + 1) - 2w = w(10^n + 1 - 2) = w(10^n - 1) \]
   - Notice that \( w = \underbrace{44 \dots 44}_{n} \) is a number consisting of \( n \) digits of 4, which can be written as:
     \[ w = 4 \cdot \frac{10^n - 1}{9} \]
   - Substituting \( w \) into the equation:
     \[ w(10^n - 1) = 4 \cdot \frac{10^n - 1}{9} \cdot (10^n - 1) = \frac{4(10^n - 1)^2}{9} \]
   - This is a perfect square since:
     \[ \left( \frac{2(10^n - 1)}{3} \right)^2 \]
   - Therefore, for \( a = 4 \), the expression is a perfect square for infinitely many \( n \).

Conclusion:
The values of \( a \) that satisfy the given condition are \( a = 1 \) and \( a = 4 \).

The final answer is \( \boxed{ \{1, 4\} } \)