user7061: We made this code in class:
 int red = 6;
  int green = 7;
  int blue = 8;
  int pot = A0;
  int potVal = 0;
  int chosenColor = 0;


void setup() {
  // put your setup code here, to run once:
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
  pinMode(pot, INPUT);
  Serial.begin (9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  potVal = analogRead(pot);
  chosenColor = map(potVal, 0, 1023, 1, 3);
  if(chosenColor = 1) {
    redCycle();
  }

  else {
    analogWrite(red,255);
  }

  if(chosenColor = 2) {
    greenCycle();
  }

  else {
    analogWrite(green,255);
  }


  if(chosenColor = 3) {
    blueCycle();
  }

  else {
    analogWrite(blue,255);
  }
  Serial.println(chosenColor);
  Serial.println(potVal);
  delay(500);
}

void redCycle() { 
    analogWrite(red,0);
  for(int i=0; i < 256; i+=5) {
    analogWrite(red, i);
  }
}

void greenCycle() {
  analogWrite(green,0);
  for(int i=0; i < 256; i+=5) {
    analogWrite(green, i);
  }
}

void blueCycle() {
  analogWrite(blue,0);
  for(int i=0; i < 256; i+=5) {
    analogWrite(blue, i);
  }
}

When we open the serial monitor we find that chosenColor is always 3 regardless of what the potVal is reading. I am sure is something simple but we can't find where is the error. Please help.

user10794: You are confusing = (assign) with == (compare).
eg.
Wrong! ...
if (chosenColor = 3)  // this assigns 3 to chosenColor

Correct:
if (chosenColor == 3)   // compare



Still not sure why the map function is not working. 

You just assumed it is not working. Before making assumptions like this do a Serial print to show what the return value of the map function is. (Directly after calling map - not later on in the code).

user3917: As Edgar Bonet pointed out,  “chosenColor = 3 means 'let chosenColor take the value 3'”.  That is, your  potVal = analogRead(pot);  chosenColor = map(potVal, 0, 1023, 1, 3); sequence may very well be working, but by the time you get to Serial.println(chosenColor); you have changed chosenColor to 3.
First, the statement if(chosenColor = 1) {...} changes chosenColor to 1. Then the statement if(chosenColor = 2) {...} changes chosenColor to 2.  Finally, if(chosenColor = 3) {...} changes chosenColor to 3, just before you print out the current value of chosenColor.  
When you wish to compare two numeric values for equality, use == instead of =.

7061: <p>We made this code in class:</p>

<pre><code> int red = 6;
  int green = 7;
  int blue = 8;
  int pot = A0;
  int potVal = 0;
  int chosenColor = 0;


void setup() {
  // put your setup code here, to run once:
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
  pinMode(pot, INPUT);
  Serial.begin (9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  potVal = analogRead(pot);
  chosenColor = map(potVal, 0, 1023, 1, 3);
  if(chosenColor = 1) {
    redCycle();
  }

  else {
    analogWrite(red,255);
  }

  if(chosenColor = 2) {
    greenCycle();
  }

  else {
    analogWrite(green,255);
  }


  if(chosenColor = 3) {
    blueCycle();
  }

  else {
    analogWrite(blue,255);
  }
  Serial.println(chosenColor);
  Serial.println(potVal);
  delay(500);
}

void redCycle() { 
    analogWrite(red,0);
  for(int i=0; i &lt; 256; i+=5) {
    analogWrite(red, i);
  }
}

void greenCycle() {
  analogWrite(green,0);
  for(int i=0; i &lt; 256; i+=5) {
    analogWrite(green, i);
  }
}

void blueCycle() {
  analogWrite(blue,0);
  for(int i=0; i &lt; 256; i+=5) {
    analogWrite(blue, i);
  }
}
</code></pre>

<p>When we open the serial monitor we find that chosenColor is always 3 regardless of what the potVal is reading. I am sure is something simple but we can't find where is the error. Please help.</p>
 10794: <p>You are confusing <code>=</code> (assign) with <code>==</code> (compare).</p>

<p>eg.</p>

<h3>Wrong! ...</h3>

<pre><code>if (chosenColor = 3)  // this assigns 3 to chosenColor
</code></pre>

<h3>Correct:</h3>

<pre><code>if (chosenColor == 3)   // compare
</code></pre>

<hr>

<blockquote>
  <p>Still not sure why the map function is not working. </p>
</blockquote>

<p>You just <em>assumed</em> it is not working. Before making assumptions like this do a Serial print to show what the return value of the map function is. (Directly after calling <code>map</code> - not later on in the code).</p>
 3917: <p>As Edgar Bonet pointed out,  “<code>chosenColor = 3</code> means 'let chosenColor take the value 3'”.  That is, your  <code>potVal = analogRead(pot);  chosenColor = map(potVal, 0, 1023, 1, 3);</code> sequence may very well be working, but by the time you get to <code>Serial.println(chosenColor);</code> you have changed <code>chosenColor</code> to 3.</p>

<p>First, the statement <code>if(chosenColor = 1) {...}</code> changes <code>chosenColor</code> to 1. Then the statement <code>if(chosenColor = 2) {...}</code> changes <code>chosenColor</code> to 2.  Finally, <code>if(chosenColor = 3) {...}</code> changes <code>chosenColor</code> to 3, just before you print out the current value of <code>chosenColor</code>.  </p>

<p>When you wish to compare two numeric values for equality, use <code>==</code> instead of <code>=</code>.</p>
